首页 新闻 会员 周边 捐助

急:EXTJS gridpanel中的checkbox列绑定问题

0
悬赏园豆:30 [已关闭问题] 关闭于 2011-02-11 15:21

绑定过后出现'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}});

 

不完全思想的主页 不完全思想 | 初学一级 | 园豆:56
提问于:2011-01-25 11:15
< >
分享
所有回答(1)
0

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}});

 

来自非洲大草原的食人虎 | 园豆:76 (初学一级) | 2011-01-25 12:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册