继续问题Kendo UI datepicker incompatible with Chrome 56,我想在我的项目中将type =“text”属性设置为KendoUI datepicker控件的HtmlAttributes。
控制的数量更多,我无法逐一设置。
有没有办法在不使用模板的情况下在项目中全局设置?我们没有为datepicker使用kendo模板。
@(Html.Kendo().DatePicker()
.Name("datepicker")
.Value("10/10/2011")
.HtmlAttributes(new { type = "text" }))
答案 0 :(得分:2)
要以较少的努力全局应用,您可以使用jQuery。
jQuery代码
$(function(){
$('.k-datepicker input').attr('type','text');
});
在布局页面或common.js(如果有的话)上调用此jQuery。