문제

그리드를 위해 RowExpander를 구성하는 데 문제가 있습니다.그리드가 확장기를 렌더링하면 각 행에 대해 이미 열리고 내부에 아무 것도 없습니다.아이콘을 클릭하면 다음 오류가 생성됩니다. NextBD가 null입니다.나는 여기에서 매우 비슷한 문제를 발견 http://www.sencha.com/forum/showthread.php? 185837-grid-papl-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);


        },

.

도움이 되었습니까?

해결책

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