I am trying to hide fields from kendo grid datasource based on some condition. tried attributes, hidden, enabled --- not working. code is looking like below.
return new kendo.data.DataSource({
schema: {
model: {
fields: {
Id: { type: 'number', nullable: false, editable: false, defaultValue:null},
Frist Name: {type: 'string', nullable: false, editable: false, defaultValue: 'fTest'},
Last Name: {type:'string', nullable: false, editable: true, defaultValue: 'LTest'},
BirthDate: {type:'date', nullable: false, editable: true},
Type: {type:'string', nullable: false, editable: true},
Field1: {type:'string', hidden:true, defaultValue: ''},
I am trying to hide Field1 if some condition is met. Any help would be greatly appreciated.
Apply "hidden: true" in column[{..}] section instead of fields:{..}
adding hidden: true to hide column during grid definition
Below are some ways to hide column
Hide a column by css selector
Hide a column by index
Hide a column by field
Hide a column by column object reference