我在使用从 ASP.NET WebAPI 生成的 ISO 8601 格式并使用 Knockout-Kendo.js 绑定到 KendoUI DatePicker 小部件时遇到问题。
参考:
http://cdn.kendostatic.com/2012.3.1315/styles/kendo.common.min.css
http://cdn.kendostatic.com/2012.3.1315/styles/kendo.default.min.css
http://cdn.kendostatic.com/2012.3.1315/js/kendo.core.min.js
http://cdn.kendostatic.com/2012.3.1315/js/kendo.web.min.js
http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js
http://rniemeyer.github.com/knockout-kendo/js/knockout-kendo.min.js
html:
<span data-bind="text: bigday"></span><br />
<input data-bind="kendoDatePicker: bigday" />
Javascript:
function ViewModel() {
var self = this;
self.bigday = ko.observable("2013-06-01T00:00:00");
// ISO 8601 date as returned from ASP.NET WebAPI
}
ko.applyBindings(new ViewModel());
http://jsfiddle.net/bschafer/NGLEp/
由于某种原因,该值没有绑定到 KendoDatePicker,但它绑定到了 span w/oa 问题。