AJJ
AJJ

Reputation: 3628

Extjs property grid

I need to display checkbox in extjs property grid for a specific property. From the api doc, its clear this can be achieved by customEditor property of property grid.

My property store: [{name: 'xxx', type: 'boolean', value:'false'},
           {name: 'yyy', type: 'checkbox', value: 'false'}]

Here i need to display checkbox for name 'yyy' row. Is this possible to do so? When i use custom editor like below,

Ext.grid.propertyGrid({
  customEditor: {
    'yyy': new Ext.grid.GridEditor(new Ext.form.checkbox())
  }
})

the checkbox is displayed in edit mode. But a string(true/false) is displayed in normal mode. I need checkbox to be displayed in normal mode also.

Please help.

Upvotes: 1

Views: 3431

Answers (1)

AJJ
AJJ

Reputation: 3628

This can be achieved using customRenderers property of propertyGrid as,

customRenderers: {
  yyy: function(value) {
    return "<input type='checkbox' name='yyy'>"
  }

}

With the above property the checkbox will be displayed in normal mode also.

Upvotes: 1

Related Questions