19

Now that ExtJS 4 got rid of the ColumnModel object, how do you apply default config options to all columns in a grid?

Adi
  • 5,089
  • 6
  • 33
  • 47
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115

1 Answers1

32

Courtesy of Stevil on the Sencha Forums:

var mygrid = Ext.create('Ext.grid.Panel', {
    //... store config, other config..., 
    columns: {
        items: [{
            header: 'Kd.-Nr.',
            dataIndex: 'id',
            width: 65,
            hidden: false
        }, {
            header: 'Firma',
            dataIndex: 'company_name'
        }],
        defaults: {
            sortable: true,
            hidden: true,
            width: 100
        }
    }
});
Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
Levi Hackwith
  • 9,232
  • 18
  • 64
  • 115