0

グリッドの RowExpander の構成に問題があります。グリッドがレンダリングされるとき、エキスパンダーは各行に対して既に開かれており、内部には何もありません。そのアイコンをクリックすると、次のエラーが生成されます: nextBd is null. ここで非常によく似た問題を見つけましたhttp://www.sencha.com/forum/showthread.php?185837-Grid-Panel-PlugIn-Rowexpander-nextBd-is-nullしかし、解決策は私にとってはうまくいかず、まだ得られませんプラグイン構成を initComponent メソッドで渡すことができない理由:

ここに私のグリッドコードがあります:



    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);


        },

4

1 に答える 1

3

rowexpanderプラグインは、と呼ばれる機能を利用しますrowbody

initComponent()この行でオーバーライドしますthis.features(すでに含まれていますrowbody):

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

したがって、このrowbody機能は含まれていません。したがって、.x-grid-rowbody-trクラスは注入されません。したがってrowexpander、そのようなクラスを見つけることができず、nextBdnull を返します。

試してみてください:

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

最後に、プラグインは で開始できませんInitComponent()。構成として宣言するか、コンストラクター内で宣言できます。詳細については、このスレッドを参照してください。

于 2012-07-29T19:29:24.743 に答える