Issue with Binding my Calendar to Local Data

3 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    31 posts
    Member since:
    Jul 2012

    Posted 28 Feb 2012 Link to this post

    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. Joshua
    Joshua avatar
    27 posts
    Member since:
    Feb 2012

    Posted 29 Feb 2012 Link to this post

    I do not know if the Kendo Calendar can be bound through DataSource.

    Can anyone comment on this and give an example?
  3. Kendo UI is VS 2017 Ready
  4. Jeremy
    Jeremy avatar
    31 posts
    Member since:
    Jul 2012

    Posted 02 Mar 2012 Link to this post

    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.
Back to Top