2

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

  • draggable (Defaults to: true)
  • sortable (Defaults to: true)
  • menuDisabled (Defaults to: false)

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

Any help appreciated.

Yoh0xFF
  • 1,450
  • 2
  • 18
  • 31

2 Answers2

4

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.

slashwhatever
  • 732
  • 8
  • 24
2

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
});
Yoh0xFF
  • 1,450
  • 2
  • 18
  • 31
  • draggable, sortable, menuDisabled are configs of 'Ext.grid.column.Column' class, not configs of 'Ext.grid.Panel' class. Here you can see working example: https://jsfiddle.net/Yoh0xFF/dd7huux5/1/ – Yoh0xFF Jun 24 '15 at 07:31