This is a migrated thread and some comments may be shown as answers.

Issue with Binding my Calendar to Local Data

2 Answers 119 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 29 Feb 2012, 12:30 AM
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: 

$(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!

2 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 29 Feb 2012, 03:49 PM
I do not know if the Kendo Calendar can be bound through DataSource.

Can anyone comment on this and give an example?
0
Jeremy
Top achievements
Rank 1
answered on 02 Mar 2012, 04:56 PM
So I see that the new betas are out and there is a beta for the calendar. I haven't seen anything like a "what's new" regarding the calendar. I'm wondering if anything in the new beta would allow for what we're trying to do.

Thanks in advance.
Tags
Calendar
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Jeremy
Top achievements
Rank 1
Share this question
or