How to set width in Ext.grid.ColumnModel as a percentage?

How to set the width Ext.grid.ColumnModelin percentage?

+3
source share
1 answer

Use numbers for column widths with a total of 100 and customize the view using forceFit, for example.

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
     }
});
+8
source

Source: https://habr.com/ru/post/1753047/


All Articles