Can anyone help how to use event from Html.Kendo().CheckBoxFor(m => m.Enable)

ぃ、小莉子 提交于 2019-12-11 04:13:39

问题


I am new to Kendo. I am using Html.Kendo().CheckBoxFor(m => m.Enable) in MVC cshtml, and I'm unable to add a change event for this checkbox. The Html.Kendo().DropDownListFor has .Events(e => e.Change("PopulateCountry")), but I dont see same type of event in CheckBox.

Can anyone help on this?


回答1:


The Html.Kendo().CheckBoxFor helper renders a regular html5 checkbox. It is not actually a kendo widget like Html.Kendo().DropDownListFor creates. I believe this is why the helper for CheckBox is lacking an .Events option.

Regardless, you can use the .HtmlAttributes option to add a change handler to the checkbox element instead:

.HtmlAttributes(new { onchange = "PopulateCountry();" })


来源:https://stackoverflow.com/questions/46623589/can-anyone-help-how-to-use-event-from-html-kendo-checkboxform-m-enable

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