Newbee question - themouette jquery-week-calendar/

354 views
Skip to first unread message

Mike

unread,
Jun 4, 2010, 2:02:11 AM6/4/10
to jquery week calendar
I'm trying to use a function to return the users to "users:". when i
get this working i'll put my .ajax code in the function to return the
users from a database.

Here is my code.

$calendar.weekCalendar({
timeslotHeight: 30,
defaultFreeBusy: { free: true },
users: {getdata()},
........

function getEventData() {
return "[{ id: 11, name: "mike" }, { id: 12, name: "joe" }, { id: 13,
name: "sam" }"
}

Thanks for any help.

Julien MUETTON

unread,
Jun 4, 2010, 3:23:12 AM6/4/10
to jquery-wee...@googlegroups.com
Hi,

you need to provide a real array to users, so try

$calendar.weekCalendar({
       timeslotHeight: 30,
       defaultFreeBusy: { free: true },
       users: getdata(),
       ........

and it should do the trick

Julien

MoUeTtE

unread,
Jun 4, 2010, 5:03:19 AM6/4/10
to jquery week calendar
I missread your post.
Even though the modified code works with local data, if it is ajax,
you have to pass it in the data callback, with your events.

$calendar.weekCalendar({
data: 'your/data.url.json'
...

and your data to return:
{
options:{
users: [{your user}, {your user}]
},
events:[
{event1},
{event2}
],
freebusys:[
{free-busy-1},
{free-busy-2}
]
}
(as valid json of course, to validate json: http://www.jsonlint.com)

cheers,

Julien.

On 4 juin, 09:23, Julien MUETTON <the.moue...@gmail.com> wrote:
> Hi,
>
> you need to provide a real array to users, so try
>
> $calendar.weekCalendar({
>        timeslotHeight: 30,
>        defaultFreeBusy: { free: true },
>        users: getdata(),
>        ........
>
> and it should do the trick
>
> Julien
>

NoobCoder

unread,
Feb 7, 2016, 11:15:03 AM2/7/16
to jquery week calendar
hi julien,

can you show how you construct your json document here : data.url.json

Thanks

NoobCoder

unread,
Feb 7, 2016, 11:32:21 AM2/7/16
to jquery week calendar
This is wonderful.. i solved the problem.. thank you for this post.. i was able to get the user from database and display it on the calendar on a fly....


On Friday, June 4, 2010 at 2:03:19 AM UTC-7, julien muetton wrote:
Reply all
Reply to author
Forward
0 new messages