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

爱⌒轻易说出口 提交于 2019-12-07 11:53:57

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/3174966/how-to-set-width-in-ext-grid-columnmodel-in-percentage-terms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!