how to retrieve an instance of kendo scheduler in MVC and add a new property to this

筅森魡賤 提交于 2019-12-25 16:00:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!