extjs4 - extjs grid - how to make column width 100% -


the property width pixel width.

{                 xtype: 'grid',                 store: store,                 selmodel: ext.create('ext.selection.checkboxmodel', {                     mode: 'single'                 }),                 layout: 'fit',                 columns: [                     {                         text: "pum",                         dataindex: 'srd_name_fl',                         width: 400                     }                 ],                 columnlines: true             } 

if have 1 column how can make column width = 100% or if have several columns - how make last column stretch end of grid?

for extjs3, set forcefit on gridpanels viewconfig. see: http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=ext.grid.gridview

for extjs 4 set forcefit directly on gridpanel: http://docs.sencha.com/ext-js/4-0/#/api/-cfg-forcefit , use in conjunction flex on columns.

example v4

var p = ext.create('ext.grid.panel',{     forcefit: true,     columns: [{         xtype: 'gridcolumn',         header: _ll.id,         sortable: true,         resizable: false,         flex: 0, //will not resized         width: 60,         dataindex: 'id'     }, {         xtype: 'gridcolumn',         header: __ll.num,         sortable: true,         resizable: true,         flex: 1,         width: 100,         dataindex: 'number'            } }); 

example v3

var p = new ext.grid.gridpanel({     viewconfig: {             forcefit: true     },     columns: [{         xtype: 'gridcolumn',         header: _ll.id,         sortable: true,         resizable: false,         fixed: true, //will not resized         width: 60,         dataindex: 'id'     }, {         xtype: 'gridcolumn',         header: __ll.num,         sortable: true,         resizable: true,         width: 100,         dataindex: 'number'            } }); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -