[英]Kendo MVC Grid set / change edit template at runtime
I have a Kendo MVC Grid 我有一个Kendo MVC网格
@(Html.Kendo().Grid<...>() .... .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Editor_Name_A").Window(w => { w.Title(""); w.Width(700); }).DisplayDeleteConfirmation(false)) .DataSource(dataSource => dataSource ...
I have another two simple buttons: button_A
and button_B
somewhere else in the document, and what I am trying to do is, when user click button_A
, the grid will use template Editor_Name_A
, while if user click button_B
, the grid will use template Editor_Name_B
我还有另外两个简单的按钮: button_A
和button_B
在文档中的其他位置,我想做的是,当用户单击button_A
,网格将使用模板Editor_Name_A
,而如果用户单击button_B
,则网格将使用模板Editor_Name_B
It is like dynamically setting / changing the grid edit template conditionally, is there any way to achieve it? 就像有条件地动态设置/更改网格编辑模板一样,有什么方法可以实现吗?
You will probably have to do it with some javascript in the page itself and try these approaches: 您可能必须在页面本身中使用一些javascript,然后尝试以下方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.