how to retrieve an instance of kendo scheduler in

2019-09-07 05:34发布

i have used kendo scheduler like this

   @(Html.Kendo().Scheduler<myEntity>()
    .Name("scheduler")
    .Date(currentDateTime)
    //.Events(e => { e.Error("error_handler");  })
    );

now i want to retrieve the same instance and add another property to it say Events as in

       .Events(e => { e.Error("error_handler");  })

dynamically. how can i do this

1条回答
Luminary・发光体
2楼-- · 2019-09-07 06:12

You can do it in JavaScript (only):

var scheduler = $("#scheduler").data('kendoScheduler');
scheduler.bind("error", error_handler);

If you wanna set not event property you should find correct method to do it in kendo documentation and api reference

There is also .setOptons('name', value) method in most of kendo components but unfortunately it usually just change value of property and does not render comonent again with new options.

查看更多
登录 后发表回答