Ext让grid选中第一行,并且触发点击事件


     grid.getSelectionModel().selectRow(0);
     grid.fireEvent("rowclick",this,0,Ext.EventObject);

 

 

给grid绑定事件即可:

        
   listeners:{
        scope:this,
        rowclick:function(grid,rowIndex,event){
            var row=grid.getStore().getAt(rowIndex);
            if(row && row.data){
                 analysisReportInfo({nameEn:row.data.nameEn});
            }
        },
        load:function(){
             this.getSelectionModel().selectRow(0);
             this.fireEvent("rowclick",this,0,Ext.EventObject);
        }
   }

 

 

grid.getSelectionModel().selectRow(0);

grid.fireEvent('rowclick',this,0,Ext.EventObject());

你可能感兴趣的:(触发,点击事件,Ext让grid)