Igor RowExpander - nextBd é nulo
Pergunta
Eu tenho problema de configuração RowExpander para a minha grade.Quando a grade compõe o expansor já está aberto para cada linha e com nada dentro.Quando eu clicar sobre o seu ícone é gerado o seguinte erro:nextBd é nulo.Eu achei muito problema semelhante aqui http://www.sencha.com/forum/showthread.php?185837-Grid-Panel-PlugIn-Rowexpander-nextBd-is-null mas a solução não funciona para mim e ainda não obtê-lo por plugin de configuração não podem ser passados no initComponent método:
Aqui é o meu código de rede:
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);
},
Solução
O rowexpander
plugin faz uso de um recurso chamado rowbody
.
Em seu initComponent()
substituir this.features
(que já inclui rowbody
) com esta linha:
this.features = [{ftype:'filters', encode:false, local:true},{ftype:'grouping'}];
Assim, o rowbody
recurso não está incluído;assim, o .x-grid-rowbody-tr
classe não é injetado;assim, rowexpander
não consegue encontrar tal classe para nextBd
e retorna null.
Você deve tentar:
var iNewFeatures = [{ftype:'filters', encode:false, local:true},{ftype:'grouping'}];
this.features = iNewFeatures.concat( this.features );
Por último, plugins, não pode ser iniciada em InitComponent()
, você pode declará-los como configs, ou dentro do construtor.Ver esta thread para obter mais informações.