小编Car*_*rlo的帖子

extjs 4 grid fireevent itemclick

如何fireEvent itemclick在商店加载后制作.

我有这个,但它不起作用:

pcfstore.on('load', function(){
   //auto select first row;
   Ext.getCmp('pcf_grid').getSelectionModel().select(0); // this works

   //fire itemclick event
  var grid= Ext.getCmp('pcf_grid');
  grid.fireEvent('itemclick', grid, 0); //this doesnt work

}); 
Run Code Online (Sandbox Code Playgroud)

这是我itemclick在网格视图中的事件:

viewConfig: {
    listeners: {
    itemclick: function(dv, record, item, index, e) {
           alert(record.data.code);
       }
    }
}
Run Code Online (Sandbox Code Playgroud)

基本上,当网格加载时,它应该触发所选网格第一行的警报窗口.

extjs4

4
推荐指数
1
解决办法
3万
查看次数

标签 统计

extjs4 ×1