简体   繁体   中英

Define column type in Kendo Grid?

How to define a type of columns:

 schema: { model: { fields: { "Field1": { type: "date" }, "Field2": { type: "string" }, "Field3": { type: "number" } } } } 

But my problem is, I don't know how many columns I would have, and what would be their types?
And I get info about it here:

 $.each(MyColumns, function () { ("" + this.field + ": { type: " + this.type + " }"); }); 

So how can I get all that info, and stick it schema.model.fields ??

Found a solution!

 var lColumnType = $.each(self.columnsAdd, function () { return "" + this.field + ": { type: " + this.type + " }"; }); schema: { model: { fields: lColumnType } } 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM