Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set width in Ext.grid.ColumnModel in percentage terms?

How to set width in Ext.grid.ColumnModel in percentage terms?

like image 369
Pavlo Avatar asked Jan 21 '23 19:01

Pavlo


1 Answers

Use numbers for the column widths with a total of 100 and configure the view with forceFit, e.g.

var grid = new Ext.grid.GridPanel({
     cm: new Ext.grid.ColumnModel({
          columns: [{
              header: 'header1',
              dataIndex: 'data1',
              width: 30
          },{
              header: 'header2',
              dataIndex: 'data2',
              width: 30
         },{
              header: 'header3',
              dataIndex: 'data3',
              width: 40
         }]
     }),
     viewConfig: {
          forceFit: true
     }
});
like image 139
Robby Pond Avatar answered Mar 08 '23 00:03

Robby Pond