PDA

View Full Version : this.statusEl is undefined



vegesoft
15 Jun 2012, 8:57 AM
I try to clean the statusBar belonging to a hidden tab. I should mention that Ext.getCmp ("statusTablaTarea") if it is recognized successfully. Then I show you my code.


var gridTarea = Ext.create('Ext.grid.Panel', {
store: storeTarea,
disableSelection: false,
loadMask: true,
split:true,
autoScroll: true,
columns:[{
text: "Id",
dataIndex: 'id',
width: 40,
align:'right'
},{
text: "Cliente",
dataIndex: 'cliente',
width: 150,
hidden: false,
flex: 1,
sortable: true,
align:'left'
},{
text: "Remitente",
dataIndex: 'remitente',
width: 150,
hidden: false,
flex: 1,
sortable: true,
align:'left'
},{
text: "Título",
dataIndex: 'titulo',
width: 500,
hidden: false,
flex: 1,
sortable: true,
align:'left'
},{
text: "Estado",
dataIndex: 'estado',
width: 100,
hidden: false,
flex: 1,
sortable: true,
align:'right'
},{
text: "Tipo",
dataIndex: 'tipo',
width: 150,
hidden: false,
sortable: true,
align:'left'
},{
text: "Prioridad",
dataIndex: 'prioridad',
width: 100,
hidden: false,
sortable: true,
align:'right'
},{
text: "Fecha de Recepción",
dataIndex: 'strFecRecepcion',
width: 150,
hidden: false,
sortable: true,
renderer : Ext.util.Format.dateRenderer('d/m/Y H:i:s'),
align:'right'
}],
bbar: Ext.create('Ext.PagingToolbar', { //Agregamos un bottom bar
id:"bottonBarTarea",
store: storeTarea,
displayInfo: true,
displayMsg: 'Visualizando tarea {0} - {1} de {2}',
emptyMsg: "No hay tareas en proceso",
items: [
{
xtype:"statusbar",
id: 'statusTablaTarea',
// defaults to use when the status is cleared:
defaultText: 'Estado...',
defaultIconCls: 'default-icon',
// values to set initially:
busyText: 'Cargando...',
iconCls: 'ready-icon',
//width: 0,
layout: 'fit'
}],
layout: 'hbox'
})
});


Ext.create('Ext.container.Container', {
id: 'containerTarea',
height: '100%',
layout: {
type: 'border',
padding: 5
},
items: [{
region: 'east',
title:"Detalle de la tarea",
xtype: 'panel',
split: true,
collapsible: true,
html: 'aca ira el detalle de la tarea de soporte',
layout: 'fit',
border: true,
width: '50%'
},{
region: 'center',
title:"Tareas en proceso",
xtype: 'panel',
split:true,
//html: 'aca ira la grilla',
items:[gridTarea],
layout: 'fit',
border: true
}]
});




var tabPanel = Ext.createWidget('tabpanel', {
id: "tabPanelPrincipal",
width: '100%',
height: '100%',
activeTab: 0,
defaults :{
hideMode: "offsets"
},
items: [{
title: 'Correo de Soporte',
closable: false,
height: '100%',
width: '100%',
items: [Ext.getCmp("containerCorreo")]
},{
title: 'Tareas de Soporte',
closable: false,
height: '100%',
width: '100%',
items: [Ext.getCmp("containerTarea")]
}]//
});


function actionBeforeLoadStoreTarea(dataStore, operation, opciones){
console.info("1: entro al beforeload");
var statusTablaTarea = Ext.getCmp("statusTablaTarea");
statusTablaTarea.showBusy();
};


function actionLoadStoreTarea(dataStore, modelRecord, flagSuccessful, opciones){
console.info("2: entro al load");
var statusTablaTarea = Ext.getCmp("statusTablaTarea");
if(flagSuccessful){
statusTablaTarea.clearStatus(); //this.statusEl is undefined
}else{
statusTablaTarea.setStatus({
text: CONTS_MSG_ERROR_TIMEOUT,
iconCls: 'x-status-error',
clear: true // auto-clear after a set interval
});
}
};



storeTarea.on("beforeload",actionBeforeLoadStoreTarea);
storeTarea.on("load",actionLoadStoreTarea);