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

Kendo scheduler not firing change function

1 Answer 250 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 01 Aug 2016, 06:10 AM

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..

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 02 Aug 2016, 08:35 AM
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.
 
Tags
Scheduler
Asked by
developer
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or