問題如題。。
解決方法就是必須等待Grid渲染完成之后,再load store的數(shù)據(jù) 在store中增加load事件的監(jiān)聽器:
- this.store.on({
- load:{
- fn:function(){
-
- this.getSelectionModel().selectFirstRow();
- }
- },
- scope:this
- });
this.store.on({ load:{ fn:function(){ //select grid's first row using selection model this.getSelectionModel().selectFirstRow(); } }, scope:this });
再增加grid的render事件的監(jiān)聽器:
- this.on({
- render:{
- fn: function() {
- this.store.load();
- }
- },
- scope:this
- });
this.on({ render:{ fn: function() { this.store.load(); } }, scope:this });
說明:this表示grid,如果沒有渲染完就選擇,在IE6下會(huì)有問題