如何使用rowexpander插件Extjs 4.1.1在网格中展开行 [英] How to expand row in a grid using rowexpander plugin Extjs 4.1.1

查看:914
本文介绍了如何使用rowexpander插件Extjs 4.1.1在网格中展开行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用rowexpander插件在网格中展开行?我在我的控制器中使用以下代码

 'editbasicinfotitlegrid gridview':{
afterrender:this.expandAll
}

expandAll:function(){

var titlesGrid = Ext.getCmp('editBasicInfoTitleGrid');
var expander = titlesGrid.getPlugin('myRowExpander');
console.log(titlesGrid.plugins [0]);
expander.toggleRow(0);

}

但是这段代码给我以下错误

 未捕获TypeError:无法调用方法'down'null 

$所以我找到了它的解决方案。RowExpander的toggleRow()函数只能在 viewready Grid的事件。在调用此函数而不是 afterrender 为我工作。


How to expand row in a grid using rowexpander plugin? I am using the following code in my controller

'editbasicinfotitlegrid gridview' : {
            afterrender:this.expandAll
 }

expandAll: function(){

    var titlesGrid = Ext.getCmp('editBasicInfoTitleGrid');     
    var expander = titlesGrid.getPlugin('myRowExpander');
    console.log(titlesGrid.plugins[0]);
    expander.toggleRow(0);

}

But this code gives me the following error

Uncaught TypeError: Cannot call method 'down' of null 

解决方案

So I have found its solution.The toggleRow() function of RowExpander works only on viewready Event of grid.So calling this function on viewready instead of afterrender worked for me.

这篇关于如何使用rowexpander插件Extjs 4.1.1在网格中展开行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆