如何在MVC中检索kendo Scheduler的实例并向其中添加新属性 [英] how to retrieve an instance of kendo scheduler in MVC and add a new property to this

查看:120
本文介绍了如何在MVC中检索kendo Scheduler的实例并向其中添加新属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经像这样使用了剑道调度程序

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

推荐答案

您可以使用JavaScript(仅)进行操作:

You can do it in JavaScript (only):

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

如果您不想设置事件属性,则应该在kendo

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

大多数kendo组件中也有.setOptons('name', value)方法,但不幸的是,它通常只是更改属性的值,并且不会使用新选项再次呈现component.

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.

这篇关于如何在MVC中检索kendo Scheduler的实例并向其中添加新属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆