I have a function with a store load. That is:
function PdCtrl_Posicionamiento_RegistrarPosicion(numeroPrograma, tren, fechaTren, ramal, secuenciaEstacion, kilometraje, hora, minuto, tipoOrigen, eliminaDependencia) {
storePdCtrl_Posicionamiento_RegistrarPosicion.load({
params: {
numeroPrograma: numeroPrograma,
tren: tren,
fechaTren: fechaTren,
ramal: ramal,
secuenciaEstacion: secuenciaEstacion,
kilometraje: kilometraje,
hora: hora + ":" + minuto,
tipoOrigen: tipoOrigen,
eliminaDependencia: eliminaDependencia,
usuario: NOMBRE
},
callback: function () {
var estado = new Array();
var err = storePdCtrl_Posicionamiento_RegistrarPosicion.getAt(0).get('ESTADO');
var mensaje = storePdCtrl_Posicionamiento_RegistrarPosicion.getAt(0).get('MENSAJE');
estado.push(err);
estado.push(mensaje);
return estado;
},
});
}
And I need to get the returned value (the array) in other place (in the function call) but for the way that ExtJs works (async), I can't get the array. The following lines don't work:
var vl_estado = PdCtrl_Posicionamiento_RegistrarPosicion(numeroPrograma, tren, fechaTren, ramal, secuenciaEstacion, kilometraje, hora, minuto, tipoOrigen, eliminaDependencia);
console.debug("estado:" + vl_estado);
When I debug the variable "estado" I don't have any value. Maybe I don't explain the situation in a good way. Sorry and thanks.