0

Basically I have a parent grid with row expander, when we expand each row, it will show the children grid with row expander as well.

I realized that when I click on the expander in nested grid, it's getting the record from parent row instead of its own data.

Which causing other errors to render the expanded body content.

What am I doing wrong in my code?

buildNestedGrid: function (ruleId) {
    var nestedExpander = new Ext.ux.grid.RowExpander({
        id: 'nestedExpander',
        tpl: new Ext.Template(
            '<div id="childRulesGrid"></div>',
            {
                compiled: true,
                disableFormats: true
            }                
        )            
    });

    //build grid
    var nestedGrid = new Ext.grid.GridPanel({
        id: 'childRuleGrid',
        store: this.buildStoreForChildRules(ruleId),
        height: 150,
        hideHeaders: true,
        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');     


}
jenna_3108
  • 437
  • 1
  • 7
  • 20
  • 1
    Please post a complete standalone code snippet that I could paste into a fiddle and launch. Also, ExtJS is somewhat niche as is, and on top of that you're using an old version. Consider upgrading to extjs6 to increase chance of getting help online. – Coderino Javarino Jan 11 '19 at 11:31
  • the code for `buildStoreForChildRules` would be usefull to help you. – Christophe Le Besnerais Feb 04 '19 at 14:48

0 Answers0