Yoh0xFF
Yoh0xFF

Reputation: 1496

Ext JS, change grid column configs default values globally

Ext.grid.column.Column class has following configs:

Is it possible to change default values of this configs globally for all grid columns in my application ?

Any help appreciated.

Upvotes: 2

Views: 1360

Answers (2)

vela1606
vela1606

Reputation: 56

yes, using Ext.override......

http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext-method-override

example...

Ext.override(Ext.grid.column.Column, {
 draggable: true,
 sortable: true,
 menuDisabled: false
});

Upvotes: 2

slashwhatever
slashwhatever

Reputation: 731

Given that the accepted answer is for ExtJS 5.x, I thought it would be useful to have an answer for ExtJS 4.x too.

Something like the following should do it:

  Ext.define('Ext.my.grid.column.Column', {
    override : 'Ext.grid.column.Column',
    draggable : false,
    sortable : false,
    menuDisabled : true
  });

Now every time you use a column in a grid, it will take these as defaults.

Upvotes: 4

Related Questions