ExtJS 4: Apply Defaults to all columns in a grid ExtJS 4: Apply Defaults to all columns in a grid javascript javascript

ExtJS 4: Apply Defaults to all columns in a grid


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        }    }});