如何定义列类型:
schema: {
model: {
fields: {
"Field1": {
type: "date"
},
"Field2": {
type: "string"
},
"Field3": {
type: "number"
}
}
}
}
但我的问题是,我不知道我会有多少列,以及它们的类型是什么?
我在这里获取有关它的信息:
$.each(MyColumns, function () {
("" + this.field + ": { type: " + this.type + " }");
});
那么我怎样才能获得所有这些信息,并将其粘贴到schema.model.fields??
最佳答案
找到解决方案!
var lColumnType =
$.each(self.columnsAdd, function () {
return "" + this.field + ": { type: " + this.type + " }";
});
schema: {
model: {
fields: lColumnType
}
}
关于javascript - 在 Kendo Grid 中定义列类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35573021/