浏览 9576 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (10)
|
|
---|---|
作者 | 正文 |
发表时间:2008-06-06
不懂就看一下下面的例子吧!。。。 //获得store,这里假如store里有3条记录。 var i = 0; var ds = grid.getStore(); \\ //以下是正确与不正确的例子 1)错误例子 ds.each(function(rec) { i++; } ); result : i = 0;//表明each没有执行或此方法在数据加载前执行(后者的可能行更大) 2)正确例子 ds.on('load',function(store,records){ store.each(function(rec) { i++; } ); }); result: i = 3; 下面看一下如何使grid中的checkBox为选中状态 var sm = grid.getSelectionModel();//get the seletion model ds.on('load',function(store,records){ store.each(function(rec) { //判断条件 if(....) { sm.selectRecords([rec]); } ); }); 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |