Kendo Update Scheduler Options Dynamically

I am using KendoUI scheduler with AngularJS.

I am declaring the scheduler parameters as per the documentation, pretty standard. See below:

What I would like to do is update $scope.schedulerOptions

and make these changes to the UI. When I make changes to $scope.schedulerOptions

, nothing changes in the user interface.

Any ideas on how to do this?

$scope.schedulerOptions = {
        date: new Date("2013/6/13"),
        startTime: new Date("2013/6/13 07:00 AM"),
        height: 600,
        views: [
            "day",
            { type: "workWeek", selected: true },
            "week",
            "month",
        ],
        eventTemplate: "<span class='custom-event'>{{dataItem.title}}</span>",
        allDayEventTemplate: "<div class='custom-all-day-event'>{{dataItem.title}}</div>",
        timezone: "Etc/UTC",
        dataSource: {
            batch: true,
            transport: {
                read: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks",
                    dataType: "jsonp"
                },
                update: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/update",
                    type: "PUT"
                },
                create: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/create",
                    type: "POST"
                },
                destroy: {
                    url: "http://demos.telerik.com/kendo-ui/service/tasks/destroy",
                    type: "DELETE"
                },
                parameterMap: function(options, operation) {
                    if (operation !== "read" && options.models) {
                        return {models: kendo.stringify(options.models)};
                    }
                }
            },
            schema: {
                model: {
                    id: "taskId",
                    fields: {
                        taskId: { from: "TaskID", type: "number" },
                        title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                        start: { type: "date", from: "Start" },
                        end: { type: "date", from: "End" },
                        startTimezone: { from: "StartTimezone" },
                        endTimezone: { from: "EndTimezone" },
                        description: { from: "Description" },
                        recurrenceId: { from: "RecurrenceID" },
                        recurrenceRule: { from: "RecurrenceRule" },
                        recurrenceException: { from: "RecurrenceException" },
                        ownerId: { from: "OwnerID", defaultValue: 1 },
                        isAllDay: { type: "boolean", from: "IsAllDay" }
                    }
                }
            },
            filter: {
                logic: "or",
                filters: [
                    { field: "ownerId", operator: "eq", value: 1 },
                    { field: "ownerId", operator: "eq", value: 2 }
                ]
            }
        },
        resources: [
            {
                field: "ownerId",
                title: "Owner",
                dataSource: [
                    { text: "Alex", value: 1, color: "#f8a398" },
                    { text: "Bob", value: 2, color: "#51a0ed" },
                    { text: "Charlie", value: 3, color: "#56ca85" }
                ]
            }
        ]
    };

      

+1


source to share


1 answer


According to this post on telerik forum you can change the values ​​after initialization by changing the HTML before <div kendo-scheduler="sched" k-options="options"></div>

and accessing the schedule as a model variable$scope.sched.setOptions(...);



+3


source







All Articles