基本上,我有一个带有行扩展器的父网格,当我们扩展每一行时,它也会显示带有行扩展器的子网格。
Parent Grid
Nested Grid
我面临的问题是嵌套网格中的行扩展器无法扩展。
未捕获的TypeError:无法设置未定义的属性“ innerHTML”
我在此reference
中尝试过的事情nestedGrid.getEl().swallowEvent([
'mousedown', 'mouseup', 'click',
'contextmenu', 'mouseover', 'mouseout',
'dblclick', 'mousemove'
但是,单击扩展器后,不再响应折叠/扩展。
感谢有人指出错误/问题。谢谢。
我在父网格中的行扩展器绑定到rowExpanderOnExpandListener
rowExpanderOnExpandListener: function (rowIndex) {
var selectedRuleId = this.getStore().getAt(rowIndex).data.Id;
this.buildNestedGrid(selectedRuleId);
},
buildNestedGrid: function (ruleId) {
var nestedExpander = new Ext.ux.grid.RowExpander({
id: 'nestedExpander',
tpl: '<div>TEST TEST</div>'
});
//build grid
var nestedGrid = new Ext.grid.GridPanel({
id: 'childRuleGrid',
store: this.buildStoreForChildRules(ruleId),
height: 150,
columns: [
nestedExpander,
{
id: 'id',
header: 'Id',
dataIndex: 'Id'
},
{
id: 'parentId',
header: 'Parent Id',
dataIndex: 'ParentId'
},
{
id: 'condition',
header: 'Condition',
dataIndex: 'Condition'
},
{
id: 'conclusion',
header: 'Conclusion',
dataIndex: 'Conclusion'
},
{
id: 'createdBy',
header: 'Created By',
dataIndex: 'CreatedBy'
},
{
id: 'createdOn',
header: 'Created On',
dataIndex: 'CreatedOn'
}
],
viewConfig: {
forceFit: true
}
});
nestedGrid.render('childRulesGrid');
nestedGrid.getEl().swallowEvent([
'mousedown', 'mouseup', 'click',
'contextmenu', 'mouseover', 'mouseout',
'dblclick', 'mousemove'
]);
nestedExpander.on('click', function() {
alert('clicked');
});
},