【发布时间】:2015-11-18 10:22:09
【问题描述】:
我有一个带有两个网格的小部件。
When selected a row of the first grid is done the load of the second grid 根据请求发送的 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 版本?
-
我使用的是 EXTJS 5.1。 store.load 产生错误;未捕获的错误:无法修改 ext-store-empty。关于请求:成功:{成功:真},总数:“4”,但存储rootProperty返回null。奇怪的是,例如,如果网格在布局 hbox 中,它工作得很好。如果第二个网格在窗口内,则不会加载。谢谢德雷克。
-
窗口内的网格是否有唯一的
itemId?您确定Ext.ComponentQuery.query('#gridItemId')[0]返回窗口内的网格而不是任何其他网格吗? -
是的。我又检查了一遍。
标签: javascript extjs grid store