0

I have problem configuring RowExpander for my grid. When the grid renders the expander is already opened for each row and with nothing inside. When i click on its icon the following error is generated: nextBd is null. I found very similar problem here http://www.sencha.com/forum/showthread.php?185837-Grid-Panel-PlugIn-Rowexpander-nextBd-is-null but the solution does not work for me and still dont get it why plugin config cannot be passed in initComponent method:

Here is my grid code:



    Ext.define('GSIP.view.plans.PlanReqList' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.gsip_devplan_list',
        id: 'gsip_plan_list',
        plugins: [{
            ptype: 'rowexpander',
            rowBodyTpl : [
                'Nazwa:{name}'
            ]
        }],
        //title:i18n.getMsg('gsip.view.PlanReqList.title'), 
        layout: 'fit',
        initComponent: function() {


            this.store = 'DevPlan';

    //      this.plugins = [{
    //            ptype: 'rowexpander',
    //            rowBodyTpl : [
    //                {name}
    //            ]
    //        }];

            this.features = [{ftype:'filters', encode:false, local:true},{ftype:'grouping'}];

            this.tbar = [{
                xtype:'commandbutton',
                id: 'newReq',
                iconCls:'icon-application_add',
                text: i18n.getMsg('gsip.view.plans.PlanReqList.addReq'),
                command: 'newReq',
            }];

            this.viewConfig = {
                forceFit:true,
                getRowClass: function(record, index) {
                    var c = record.get('elapsedPercent');
                    if (c >= 0) {                   
                        return 'elapsed-normal';
                    } 
                }
            }

            this.columns = [
                {header: "Id", dataIndex: "id", width:50, sortable: true, filter:{type:'numeric'}},
                {header: i18n.getMsg('gsip.view.plans.PlanReqList.column.name'), dataIndex: "name", flex:1, sortable: true, filter:{type:'string'} },

                }
            ];


            this.callParent(arguments);


        },

1
  • Awesome, that was exactly the problem. You helped me again! Many thanks.
    – patryks
    Jul 28, 2012 at 21:33

1 Answer 1

3

The rowexpander plugin makes use of a feature called rowbody.

In your initComponent() you override this.features (which already includes rowbody) with this line:

this.features = [{ftype:'filters', encode:false, local:true},{ftype:'grouping'}];

Thus the rowbody feature is not included; thus the .x-grid-rowbody-tr class is not injected; thus rowexpander can't find such class for nextBd and returns null.

You should try:

var iNewFeatures = [{ftype:'filters', encode:false, local:true},{ftype:'grouping'}];
this.features = iNewFeatures.concat( this.features );

Lastly, plugins cannot be initiated in InitComponent(), you can either declare them as configs, or within the constructor. See this thread for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.