【发布时间】:2016-11-25 10:19:18
【问题描述】:
我用 ExtJS 3.4 制作了一个 GridPanel,高度:200。我有时需要改变高度。
当我 setHeight(65) 使它更短,然后 setHeight 回到原来的高度:200,网格似乎回到了 200 的高度,但里面的内容仍然是我设置高度的样子65 个。 我在 setHeight 之后尝试过,但没有运气:
grid.setHeight(200);
//myStore.load();
//myStore.reload();
//myStore.getStore().load();
//grid.render();
//grid.getView().refresh();
//grid.getView().refresh(true);
//grid.getView().updateLayout();
//grid.doLayout(); //just tried not okay
//the code:
grid = new Ext.grid.GridPanel({
id: "myGrid",
store: myStore,
selModel: mySelectionModel,
columns: [
mySelectionModel,
{
id: 'name',
header: "Item",
width: 240,
menuDisabled: true,
dataIndex: 'name'
}
],
height: 200,
width: 280,
listeners: {
"keydown": function (e) {
if (e.getKey() == 17) {
mySelectionModel.clearSelections();
}
}
}
});
//another item on top of the gird enlarged code here, so shorter the grid:
grid.setHeight(65)
//the item on top returned to be smaller code here
//so then I return the height of the grid to its original in the line below:
grid.setHeight(200);
//however, after the above line, the content remains as the height of 65
【问题讨论】:
-
你能加一个简单的小提琴吗?
-
或者只是添加更多代码?什么是网格?网格还是网格视图?
标签: javascript extjs height refresh