【问题标题】:How to set type="text" HtmlAttribute of KendoUI datepicker MVC control globally in a application?如何在应用程序中全局设置 KendoUI datepicker MVC 控件的 type="text" HtmlAttribute?
【发布时间】:2017-06-27 00:02:47
【问题描述】:

继续问题Kendo UI datepicker incompatible with Chrome 56,我想在我的项目中将type = "text" 属性设置为KendoUI datepicker 控件的HtmlAttributes。

控件数量较多,无法一一设置。

有没有办法在不使用模板的情况下在项目中全局设置它?我们还没有为 datepicker 使用剑道模板。

@(Html.Kendo().DatePicker()
.Name("datepicker")
.Value("10/10/2011")
.HtmlAttributes(new { type = "text" }))

【问题讨论】:

    标签: asp.net-mvc kendo-ui datepicker


    【解决方案1】:

    要更轻松地在全球范围内应用,您可以使用 jQuery。

    jQuery 代码

    $(function(){ 
        $('.k-datepicker input').attr('type','text');
    });
    

    在布局页面或 common.js(如果有)上调用此 jQuery。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-14
      相关资源
      最近更新 更多