问题
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:
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.
来源:https://stackoverflow.com/questions/26462371/how-to-retrieve-an-instance-of-kendo-scheduler-in-mvc-and-add-a-new-property-to