0
我想改變Kendo DateTimePicker的language.Added文件文件來改變頁面load.It的工作很好,如果我不應用knockoutjs binding.But我必須使用淘汰賽的數據綁定,使其工作。MVC-劍道DateTimePicker文化不適用於KnockoutJS?
@(Html.Kendo().DateTimePicker()
.Name("dtStart")
.Culture(@CultureHelper.GetCultureShort())
.Format("dd/MM/yyyy HH:mm")
.TimeFormat("HH:mm")
.ParseFormats(new string[] { "MM/dd/yyyy" })
.Events(e => e.Change("dtStart_onChange"))
//It stops changing to culture if i use "data-bind" here
//.HtmlAttributes(new { data_bind = "kendoDateTimePicker: selectedStartDate" })
)
試過這個,但腳本在datepicker創建之前工作;
JS:
var lang = '@CultureHelper.GetCultureShort()';
$("#dtStart").kendoDatePicker({
culture: lang,
//....
});
四處錯誤:未捕獲的類型錯誤:無法調用「setOptions」未定義 – balron
啊,這是「 KendoDateTimePicker「不是」KendoDatePicker「。我的錯誤.... 感謝您的answer.Now它的作品。 – balron
我認爲Kendo MVC有一個bug在使用HtmlAttributes()內的數據綁定時,DateTimePicker.Culture()屬性不起作用。 – balron