Javascript 在剑道网格UI中打开编辑器时发生日期选择器错误
当我在剑道网格UI中打开编辑器时,出现如下错误 未捕获的TypeError:e.indexOf不是函数..kendo.all.js:1179 我想这是一个约束问题 下面是我的代码片段Javascript 在剑道网格UI中打开编辑器时发生日期选择器错误,javascript,jquery,spring,kendo-ui,kendo-grid,Javascript,Jquery,Spring,Kendo Ui,Kendo Grid,当我在剑道网格UI中打开编辑器时,出现如下错误 未捕获的TypeError:e.indexOf不是函数..kendo.all.js:1179 我想这是一个约束问题 下面是我的代码片段 数据源模式 schema : { model : { id : "cid", fields : { cid : { type : "number"
schema : {
model : {
id : "cid",
fields : {
cid : {
type : "number"
},
meainInstDtm : {
type : "datetime"
},
}
}
$("#grid").kendoGrid({
dataSource : dataSource,
columns : [ {
field : "cid",
title : "CID"
}, {
field : "meainInstDtm",
title : "meainInstDtm",
width: 150,
editor: dateTimeEditor,
attributes: {
style: "text-align: center;"
}
}, {
command: [{name: 'edit'}, { name: 'destroy'}], title: " ", width:"180px", filterable:false
}],
editable: "popup"
})
function dateTimeEditor(container, options) {
$('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '" data-format="' + options.format + '"/>')
.appendTo(container)
.kendoDateTimePicker({});
}
函数dateTimeEditor(容器、选项){
$('')
.appendTo(容器)
.kendoDateTimePicker({});
}
我不知道是什么问题。帮助我。我将模式类型修改为
date
,并在编辑事件中添加了条件。这对我很有用。我将模式类型修改为date
,并在编辑事件中添加了条件。这对我很有用。if语句在哪里调用?检查我在这里制作的dojo,看看是否可以重现这个问题:@MattOG顶部的代码是kendo.js。我不调用if语句。你能提供一个我们可以测试的方法吗?@CaraTilos这是我的小提琴。if语句在哪里调用?检查我在这里制作的dojo,看看是否可以重现这个问题:@MattOG顶部的代码是kendo.js。我不调用if语句。你能提供一个我们可以测试的方法吗?@CaraTilos这是我的提琴。当它将datetime
type修改为date
type时,会出现相同的错误…这里:说明类型必须是date,而不是datetime:options.fields.fieldName.type字符串指定字段的类型。可用选项有“字符串”、“数字”、“布尔值”、“日期”和“对象”。默认值为“字符串”。请尝试此选项。我没有遇到错误。当它将datetime
type修改为date
type时,会出现相同的错误…此处:说明类型必须是date,而不是datetime:options.fields.fieldName.type字符串指定字段的类型。可用选项有“字符串”、“数字”、“布尔值”、“日期”和“对象”。默认值为“字符串”。请尝试此选项。我没有遇到这个错误。
function dateTimeEditor(container, options) {
$('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '" data-format="' + options.format + '"/>')
.appendTo(container)
.kendoDateTimePicker({});
}