0
我有兩個網格的小部件。在模態窗口內加載網格
當選中第一個網格的一行時,根據請求發送的id_note加載第二個網格 。
如果網格是,例如,在一個佈局hbox,它運作良好。
但是,當第二個網格位於模式窗口內時,存儲裝載失敗。
什麼是我的代碼失敗?
(...)
},{
xtype: 'actioncolumn',
text:'Notes',
minWidth: 40,
flex:0.30,
align:'center',
items: [{
icon: 'resources/images/loadWin.png',
tooltip: 'show window',
handler: function(grid, record, item, index, e, eOpts){
var selectRow = grid.getSelectionModel().select(record);
var selection = grid.getSelectionModel().getLastSelected(record);
var id_note= selection.get('id_note');
var win = Ext.widget('popupWindow', {
animateTarget : item,
}).show();
var grid = Ext.ComponentQuery.query('#gridItemId')[0]; //grid within win
var store = grid.getStore();
store.proxy.extraParams = {
'id_note': id_note
},
//Right up to this point
store.load(); //**PROBLEM HERE**
}
}
(...)
沒有足夠的細節。商店如何加載失敗?你看到了什麼?它是否打電話給服務器?是否有錯誤訊息?你使用的是什麼Ext JS版本? – Greendrake
我正在使用EXTJS 5.1。 store.load生成一個錯誤;未捕獲錯誤:無法修改ext-store-empty。關於請求:成功:{success:true},總數:「4」,但商店rootProperty返回null。奇怪的是,如果網格是在一個佈局hbox中,它運作良好。只是如果第二個網格在窗口內不加載。感謝德雷克。 – josei
窗口內的網格是否有唯一的'itemId'?你確定'Ext.ComponentQuery.query('#gridItemId')[0]'返回窗口內的網格而不是其他任何網格嗎? – Greendrake