Kendo scheduler not firing change function

2 posts, 1 answers
  1. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 01 Aug Link to this post

    I'm using Kendo scheduler with angular js  and here is my schedulerOptions.

    My requirement-I want to trigger a function on change of a date/select week /select day/month option .

    But unfortunately the change function is not triggering any event.

    Here is the code..

       

          $scope.schedulerOptions = {
                        date: new Date(),
                       startTime: new Date(),
                        height: 800,
                        views: [
                            "day",
                            "week",
                            "month",
                            { type: "month", selected: true }
                        ],
                        change: scheduler_change,
                        eventTemplate: $("#event-template").html(),
                        editable: {
                            destroy: false, //removes close button from the label
                            template: $("#editor").html()
                        },
                        edit: onEditClick,
                        timezone: "Etc/UTC",
                        dataSource: {
                            batch: true,
                            data: outputTypeArray,
                            schema: {
                                model: {
                                    id: "id",
                                    fields: {
                                        id: { from: "id", type: "number" },
                                        title: { from: "name", defaultValue: "NA", validation: { required: true } },
                                        name: { from: "name", defaultValue: "NA", validation: { required: true } },
                                        status: { from: "status", defaultValue: "NA", validation: { required: true } },
                                        trip: { from: "trips", defaultValue: "NA", validation: { required: true } },
                                        client: { from: "client", defaultValue: "NA", validation: { required: true } },
                                        start: { type: "date", from: "start" },
                                        end: { type: "date", from: "end" },
                                        colorId: { from: "colorId" }
                                    }
                                }
                            }
                        },
                        footer: false
                    };
                }
     
     
          function scheduler_change(e) {
                    var start = e.start; //selection start dates
                    var end = e.end; //selection end date
                    var slots = e.slots; //list of selected slots
                    var events = e.events; //list of selected Scheduler events
     
                    var message = "change:: selection from {0:g} till {1:g}";
     
                    if (events.length) {
                        message += ". The selected event is '" + events[events.length - 1].title + "'";
                    }
     
                    console.log(kendo.format(message, start, end));
                }
     

     

    Can you please help me on this..

  2. Answer
    Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    353 posts

    Posted 02 Aug Link to this post

    Hi,

    The event, fired on changing the current view is navigate (instead of change, as in the provided code sample):

    http://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler#events-navigate

    The current action that has fired the event is available via e.action, and the current view - via e.view.

    I hope this helps.

    Regards,
    Dimiter Topalov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. Kendo UI is VS 2017 Ready
Back to Top