0
我有一個kendo網格自定義編輯器的問題。當我點擊劍道網格上的編輯按鈕時,我想使用dateTimePicker作爲我的編輯器。但是,當我嘗試定製我的dateTimePicker的網格,總有一個錯誤:Kendo Grid內嵌編輯DateTime
Uncaught TypeError: e.indexOf is not a function ---------- kendo.custom.min.js:1
下面是簡單的源代碼:
var data = [
{"id":1, "dateTime": 1420947900000},
{"id":2, "dateTime": 1421034300000},
{"id":3, "dateTime": 1421036100000},
];
$("#grid").kendoGrid({
selectable: true,
editable: "inline",
columns: [
{
field: "dateTime",
title: "<center>Date Time</center>",
width: "200px",
format: "{0:MM/dd/yyyy hh:mm}",
template: "#= kendo.toString(new Date(parseInt(dateTime)), 'MM/dd/yyyy hh:mm') #",
editor: dateTimeEditor2
},
{ command: ["edit", "destroy"], title: " ", width: "170px" }
],
dataSource: {
transport: {
read: function(e) {
e.success(data);
},
update: function(e) {
//my update Function
alert(e.dateTime);
},
autosync: true
},
schema: {
model: {
id: "id",
fields: {
dateTime: { type: "datetime" },
}
}
}
}
});
function dateTimeEditor2(container, options) {
$('<input data-text-field="' + options.field + '" data-value-field="' + options.field
+ '" data-bind="value:' + options.field + '" />')
.appendTo(container)
.kendoDateTimePicker({
format:"MM/dd/yyyy hh:mm",
value: new Date(options.model.dateTime)
});
}
或者你可以檢查這個link
我已經在許多不同的來源檢查過它,例如: