绑定过后出现'this.grid.store' is null or not an object的错误提示。我觉得问题就是在Load事件上,但是不清楚应该怎么书写才正确。请高手指点。多谢!
代码如下:
var selModel = new Ext.grid.CheckboxSelectionModel();
checkSearchDetailStore=new Ext.data.GroupingStore({
proxy:new Ext.data.HttpProxy(
{
url:"../BackGroundData.aspx",
method:"POST"
}),
reader:new Ext.data.JsonReader(
{
fields:checkSearchDetailFields,
root:"data",
id:"XH"
}),
sortInfo: {field:'XH',direction: "ASC"},
listeners: {
'load': function(store) {
var index = 0;
store.each(function(record) {
if(record.data.YSXXC008 == '1') { //column_name 替换成你的列名, '1' 替换成你的值
selModel.selectRow(index);
}
index++;
})
}
}
});
checkSearchDetailStore.load({params:{module:'checkSearchDetail',tx:number}});
1 var selModel = new Ext.grid.CheckboxSelectionModel();
2
3 var checkSearchDetailStore=new Ext.data.GroupingStore({
4 proxy:new Ext.data.HttpProxy(
5 {
6 url:"../BackGroundData.aspx",
7 method:"POST"
8 }),
9 reader:new Ext.data.JsonReader(
10 {
11 root:"data",
12 id:"XH"
13 }),
14 sortInfo: {field:'XH',direction: "ASC"},
15 listeners: {
16 'load': function(store) {
17 var index = 0;
18 store.each(function(record) {
19 if(record.data.YSXXC008 == '1') { //column_name 替换成你的列名, '1' 替换成你的值
20 selModel.selectRow(index);
21 }
22 index++;
23 })
24 }
25 },
26 [' checkSearchDetailFields']
27 });
28
29 checkSearchDetailStore.load({params:{module:'checkSearchDetail',tx:number}});