Hi!


I got a problem with a migration from Sencha 4.2 to Sencha 7.x


I created a component from Ext.grid.Panel, but I get an error in the ext-all-debug.js.
The error is found in the beginLayoutCycle method of the Ext.grid.ColumnComponentLayout component.


My component is:


Ext.define('Ext.ux.grid.PlanitPanel', {
extend: 'Ext.grid.Panel',
excelTitle: '',
tituloReporte: '',
formatoEstandar: true,
EsCSV: false,
filasSeleccionadas: new Array(),
columnLines: true,
autoSizeDefault: true,
processedAutoSize: false,
showDefaultBottomBar: false,
showDefaultButtomExportar: true,
customViewConfig: null,
onExportToExcel: null,
bbarDefault: [
{ xtype: 'tbtext', text: '', itemId: 'displayItemResult', id: this.id + '-gridToolbar_lblResult' },
'->',
{ xtype: 'button',
text: '<span class="colorPurpura">' + Belcorp.Planit.EntornoTrabajo.Resource.SharedStrings.EtiquetaExportar + '</span>',
handler: this.exportToExcel, scope: this,
id: this.id + '-gridToolbar_btnExportar',
overCls: 'colorPurpura',
menuActiveCls: 'colorPurpura',
alternateClassName: 'colorPurpura',
pressedCls: 'colorPurpura',
focusCls: 'colorPurpura'
}
],


viewConfig: {
enableTextSelection: true,
constMaxWidth: 6.7,
constPadLeftCell: 20,
showEmptyMessage: false,
emptyText: Belcorp.Planit.EntornoTrabajo.Resource.SharedStrings.MensajeRegistrosNoEncontrados,
stripeRows: true,


setAutoSizeColumn: function () {
var me = this;


if (!me.ownerCt.processedAutoSize) {
var store = me.getStore();


if (me.ownerCt.autoSizeDefault) {
Ext.Array.each(me.getHeaderCt().getGridColumns(),
function (item, indice, items) {
if (!(item.hidden && !item.hideable) && item.defaultWidth == item.width) {
var maxWidth = store.maxLengthRecords[item.dataIndex];
if (maxWidth && maxWidth !== null && item.width != maxWidth) {
item.width = maxWidth;
me.getHeaderCt().getGridColumns()[indice].setWidth(Ext.util.Format.round(maxWidth * me.constMaxWidth, 0) + me.constPadLeftCell);
}
}
}
);
}


me.ownerCt.processedAutoSize = true;
}


},
refreshView: function () {
var me = this,
// If we have an ancestor in a non-boxready state (collapsed or in-transition, or hidden), and we are still waiting
// for the first refresh, then block the refresh because that first visible, expanded layout will trigger the refresh
blockedByAncestor = !me.firstRefreshDone && (!me.rendered || me.up('[collapsed],[isCollapsingOrExpanding],[hidden]'));


var lblResult = me.ownerCt.id + '-gridToolbar_lblResult';


if (me.ownerCt.showDefaultBottomBar) {
var mensaje = me.getStore().getTotalCount() + ' ' + Belcorp.Planit.EntornoTrabajo.Resource.SharedStrings.EtiquetaRegistrosEncontrados;
mensaje = mensaje + ' | ';
mensaje = mensaje + me.getStore().getCount() + ' ' + Belcorp.Planit.EntornoTrabajo.Resource.SharedStrings.EtiquetaRegistrosVisibles;


me.ownerCt.down('toolbar').down('#' + lblResult).setText(mensaje);
}


if (me.getStore().maxLengthRecords)
me.setAutoSizeColumn();


// If are blocking *an initial refresh* because of an ancestor in a non-boxready state,
// then cancel any defer on the initial refresh that is going to happen on boxReady - that will be a data-driven refresh, NOT
// a render-time, delayable refresh. This is particularly important if the boxready occurs because of the "preflight" layout
// of an animated expand. If refresh is delayed it occur during the expand animation and cause errors.
if (blockedByAncestor) {
me.deferInitialRefresh = false;
} else if (me.blockRefresh !== true) {
me.firstRefreshDone = true;
me.refresh();
}
}
},
initComponent: function () {
var me = this;
//debugger;
if (me.id == null) { me.id = Ext.id(); }
me.store.idGrid = '#' + me.id;
if (me.store.createStoreFilterList) {
Belcorp.Planit.CrearFiltros(me);
}


if (me.showDefaultBottomBar) { me.bbar = me.getBbarDefault(); }


if (me.customViewConfig != null)
{ me.viewConfig = Ext.apply(me.viewConfig, me.customViewConfig); }


me.callParent();


},
getBbarDefault: function () {
var me = this;


var defaultBar = [
{ xtype: 'tbtext', text: '', id: me.id + '-gridToolbar_lblResult' },
'->'];
if (me.showDefaultButtomExportar) {
defaultBar.push(
{ xtype: 'button',
text: '<span class="colorPurpura">' + Belcorp.Planit.EntornoTrabajo.Resource.SharedStrings.EtiquetaExportar + '</span>',
handler: me.exportToExcel, scope: me,
id: me.id + '-gridToolbar_btnExportar',
overCls: 'colorPurpura',
menuActiveCls: 'colorPurpura',
alternateClassName: 'colorPurpura',
pressedCls: 'colorPurpura',
focusCls: 'colorPurpura'
});
}


return defaultBar;
},
exportToExcel: function (btn) {
var me = this;


if (me.onExportToExcel == null) {
if (me.EsCSV) {
if (Belcorp.Planit.ExportarGridBasicoCSV) {
if (me.store.data.items.length > 0)
Belcorp.Planit.ExportarGridBasicoCSV(me, me.excelTitle, me.tituloReporte, null, me.formatoEstandar);
}
}
else {
if (Belcorp.Planit.ExportarGridBasico) {
if (me.store.data.items.length > 0)
Belcorp.Planit.ExportarGridBasico(me, me.excelTitle, me.tituloReporte, null, me.formatoEstandar);
}
}
} else {
me.onExportToExcel();
}
},
exportToExcelAspeo: function (btn) {
var me = this;


if (me.onExportToExcel == null) {
if (me.EsCSV) {
if (Belcorp.Planit.ExportarGridBasicoCSV) {
if (me.store.data.items.length > 0)
Belcorp.Planit.ExportarGridBasicoCSV(me, me.excelTitle, me.tituloReporte, null, me.formatoEstandar);
}
}
else {
if (Belcorp.Planit.ExportarGridBasico) {
if (me.store.data.items.length > 0)
Belcorp.Planit.ExportarGridBasicoAspeo(me, me.excelTitle, me.tituloReporte, null, me.formatoEstandar);
}
}
} else {
me.onExportToExcel();
}
},
exportToExcelDownCargaMasiva: function (btn) {
var me = this;
if (me.store.data.items.length > 0) {
Belcorp.Planit.ExportarGridDownCargaMasiva(me, me.excelTitle, me.tituloReporte, null, me.formatoEstandar);
}
}
});