Hello Everyone,
I'm having some issues binding my calendar to local data.
Basically, what I'm hoping to do is have someone enter in data on each day. Then the calendar would spit out the code they entered for that day. They'd be able to view the data in the month calendar view.
So I have this local data I need to bind. As far as I can tell this part is set up correctly. My issue is that I'm getting an error of "action" is not defined, and the script kills and doesn't load the calendar.
Is there something I'm not doing right here?
Here is my code:
Just to explain a little more, the "change" function opens a kendo window that will allow the user to input their "action" for that particular day.
Thanks for any help, guys and gals!
I'm having some issues binding my calendar to local data.
Basically, what I'm hoping to do is have someone enter in data on each day. Then the calendar would spit out the code they entered for that day. They'd be able to view the data in the month calendar view.
So I have this local data I need to bind. As far as I can tell this part is set up correctly. My issue is that I'm getting an error of "action" is not defined, and the script kills and doesn't load the calendar.
Is there something I'm not doing right here?
Here is my code:
$(document).ready(
function
() {
var
Priority = [
{ PriorityId:
"1"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
true
,
PersonID:
"2"
,
PriorityDate:
"02/22/12"
},
{ PriorityId:
"2"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
false
,
PersonID:
"2"
,
PriorityDate:
"02/23/12"
},
{ PriorityId:
"3"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
true
,
PersonID:
"2"
,
PriorityDate:
"02/24/12"
},
{ PriorityId:
"4"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
false
,
PersonID:
"2"
,
PriorityDate:
"02/25/12"
},
{ PriorityId:
"5"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
true
,
PersonID:
"2"
,
PriorityDate:
"02/26/12"
},
{ PriorityId:
"6"
,
Action:
"Lorem Ipsum Dolor Sit"
,
Completed:
false
,
PersonID:
"2"
,
PriorityDate:
"02/27/12"
},
];
var
today =
new
Date();
$(
"#kendoCalendar"
).kendoCalendar({
value: today,
depth:
"month"
,
format:
"dd/MM/yyy"
,
dataSource: Priority,
month: {
content:
'<div class="custom"><#= Action #></div>'
},
change:
function
(e) {
var
title =
"Today's Top Priority"
;
var
url =
"top-tasks-add.aspx"
var
win = $(
".modal-window"
);
if
(!win.data(
"kendoWindow"
)) {
// window not yet initialized
win.kendoWindow({
content: url,
title: title,
draggable:
true
,
modal:
true
,
resizable:
false
,
}).data(
"kendoWindow"
).open().center();
}
else
{
// reopening window
win.data(
"kendoWindow"
)
.refresh(url)
// request the URL via AJAX
.title(title)
.open()
// open the window
.center();
}
}
});
});
Just to explain a little more, the "change" function opens a kendo window that will allow the user to input their "action" for that particular day.
Thanks for any help, guys and gals!