码迷,mamicode.com
首页 > Web开发 > 详细

Extjs Ext.grid.column.Column 自适应内容

时间:2017-06-28 11:00:39      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:count()   opera   trap   component   author   param   success   begin   ext   

var griddb = Ext.ComponentQuery.query("Ali_DeliveryAuthorityList");
griddb = griddb[griddb.length - 1];
var store = Ext.getStore("DeliveryAuthorityStore");
store.proxy.extraParams = obj;
store.loadPage(1
, {
scope: this,
callback: function (records, operation, success) {

//有两种办法

//第一种

var grid = griddb;
var columns = grid.columns;
for (var i = 0; i < columns.length; i++) {
var column = columns[i];
grid.getView().autoSizeColumn(column);
column.setWidth(column.getWidth() + 5);
};

////--第二种Begin-自动适应列宽

var upList = griddb;
for (var i = 1; i < upList.headerCt.getColumnCount() ; i++) {
upList.headerCt.getGridColumns()[i].autoSize(i);
upList.headerCt.getGridColumns()[i].setWidth(upList.headerCt.getGridColumns()[i].getWidth() + 5);
};


////--End-自动适应列宽
loadMarsk.hide();
}
}
);

Extjs Ext.grid.column.Column 自适应内容

标签:count()   opera   trap   component   author   param   success   begin   ext   

原文地址:http://www.cnblogs.com/hqyj/p/7088445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!