質問

私のグリッドのRowExpanderの設定に問題があります。グリッドがエキスパンダーをレンダリングすると、各行ごとに既に開かれています。Iconをクリックすると、次のエラーが発生します.nextbdはNULLです。私はここで非常に似た問題を見つけました http://www.sencha.com/forum/showthread.php?185837-grid-panel-plugin-rowexpander-nextbd-is-null ですが、ソリューションは私のために機能しないため、Plugin ConfigInitComponentメソッドに渡すことはできません:

これは私のグリッドコードです:



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


        },

.

役に立ちましたか?

解決

rowexpanderプラグインは、rowbodyという機能を使用します。

あなたのinitComponent()では、この行でthis.features(既にrowbodyを含む)をオーバーライドします。

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

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

試してみるべきです:

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

最後に、PluginsはInitComponent()で開始できません。設定として、またはコンストラクタ内でそれらを宣言することができます。このスレッド詳細については

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top