Extjs GridPanel问题求教

jmx123456789 2011-08-25 05:20:27
重新显示列(原来显示5列,现在显示8列或者2列) 这个问题怎么解决,能详细点和有代码更好 谢谢高手解答了!



我这样不行什么都没显示:

customGrid.reconfigure(
new Ext.data.JsonStore({
url: "JsonDataSource/LoadLogInfo.aspx?do=custom",
root: "data",
//baseParams:{},
totalProperty: "totalCount"
}),
new Ext.grid.ColumnModel(customcm));
//重新加载数据
var storecustom = customGrid.getStore();
customGrid.getBottomToolbar().bind(storecustom);
storecustom.reload({ params: { start: 0, limit: 12} });

列头都没显示 是在弄不明白了 求解!
...全文
79 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tockits2000 2011-08-31
  • 打赏
  • 举报
回复
我这个是根据情况动态加载列的例子,应该对你能否有帮助。
// create cm
var customCM = [sm, {
id : 'firstName',
header : "Student Name",
width : 150,
sortable : true,
dataIndex : 'firstname',
renderer : this.firstName
}];


var customfieldsGrid1 = Ext.getCmp('customfieldsGrid');

var rows = customfieldsGrid1.getSelectionModel().getSelections();

var colMArray = new Array();
var i = 0;
for (; i < rows.length; i++) {
colMArray[i] = {
header : rows[i].get('fieldname'),
width : 100,
sortable : true,
dataIndex : rows[i].get('dataIndex')
}
if (rows[i].get('dataIndex') != 'firstName') {
customCM.push(colMArray[i]);
}

};

Ext.apply(this, {
columns : customCM,
sm : sm,
enableColLock : false,
loadMask : true,
view : new Ext.grid.GroupingView(),
store : CustomReportStudentsStore

});
report.grid.PaticipantGrid.superclass.initComponent.call(this);
feifeigrace 2011-08-29
  • 打赏
  • 举报
回复
帮顶一下
jmx123456789 2011-08-29
  • 打赏
  • 举报
回复
.......? 这么多天过去了 竟然没人回。。。。抑郁

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧