我做了一個由ExtJS 3.4 GridPanel,高度:200。我有時需要改變高度。ExtJS網格將不會刷新setHeight後
當我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
請問您可以添加一個簡單的小提琴嗎? –
或者只是添加更多的代碼?什麼是網格?網格或網格視圖? –