我正在使用 KendoUi 控件。我已经定义了数据源
var dataSource = new kendo.data.DataSource({
schema: {
model: {
id: "ProductID",
fields: {
ProductID: { type:"id" },
ProductName: {type:"string"}
}
}
}
});
现在我的问题是我们可以定义fileds
为array
类似
var arry = [{ProductID:{type:"id"}}, {ProductName:{type:"string"}}];
现在我们可以像这样定义数据源了吗
var dataSource = new kendo.data.DataSource({
schema: {
model: {
id: "ProductID",
fields: arry
}
}
});