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

Kendo scheduler not firing change function

1 Answer 285 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:11 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
Accepted
Dimiter Topalov
Telerik team
answered on 02 Aug 2016, 03:01 PM
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.
Tags
Scheduler
Asked by
developer
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or