【发布时间】:2013-10-29 20:07:35
【问题描述】:
我有一个 Ext JS 网格,它使用 ftype: 'grouping' 和 groupHeaderTpl: ...' 创建组行。我想确保当用户单击组行时,所有其他组行都被折叠,并且该组行被展开。
根据this page,有一个groupclick可以订阅的事件,还有collapseAll()和expand()的方法。
我已成功订阅groupclick 事件并成功调用collapseAll() 方法。但是,我无法让expand() 方法工作。
问题来了,expand() 方法要求我传入groupName,我不知道它到底想要什么。在groupclick 事件中,我可以访问一个名为group 的变量,但该变量始终是undefined。
我的问题:expand() 方法要求的groupName 是什么,我如何从groupclick 事件中访问它?是否需要在模型或网格中我看不到的地方定义?
这是我的控制器代码:
onGroupClick: function (view, node, group, e, eOpts) {
console.log(view);
console.log(node);
console.log(group) //this is always undefined
view.features[0].collapseAll(); //works fine
view.features[0].expand(groupName); //what goes here for groupName???
},
【问题讨论】:
标签: grid grouping expand extjs4.2