Kendo scheduler not firing change function

2 posts, 0 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. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 02 Aug Link to this post

    Hi,

    The 'change' event will be raised when selection is enabled.

    If you would like to listen to changes in the view types, then I would suggest you wire the dataBound event and check the view type using the view method.

    Regards,
    Georgi Krustev
    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