Now that ExtJS 4 got rid of the ColumnModel object, how do you apply default config options to all columns in a grid?
Asked
Active
Viewed 1.4k times
1 Answers
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
-
I just tried this with `align: 'center'` in `defaults` and it didn't work :( I am using ExtJS 4.1.3 – AsGoodAsItGets Mar 15 '13 at 17:32
-
The code above was written for ExtJS 4. I don't know if anything has changed in 4.1 – Levi Hackwith Mar 18 '13 at 13:27