0

Hello i have the following problem:

  1. After i generate the AP and install it on my phone the requisition store.load breaks in this specific store called CHAMADOS, but when i close the app and restart, it does not crash and bring me all the informations in the list...

  2. It seems that the .load requires bring me the informations in the first time.

  3. When i close and open it again the cache informations required before is add to the list, but the load required on the restart APP does not work.

  4. It crashs and dont add the items to the LIST, but the store has data because on restart it appears, i have others store in this app and they work fine!

  5. On brownser its fine, the problem is in the APK

Here is the view

{
  height: '60%',
  ui:'round',
  style:'padding:18px 0; background:#FFF;',
  xtype: 'dataview',
  id: 'feedListagemChamados',
  store: 'Chamados',
  itemTpl: '<span>{nom_chamado}</span>  '
}

Here is the store

Ext.define('WE3Chamados.store.Chamados', {
extend: 'Ext.data.Store',
config: {
    model: 'WE3Chamados.model.Chamado',
    autoLoad: true,
    proxy: {
        type: 'jsonp',
        url: 'http://LINK?cod_usuario='+localStorage.getItem("usuarioId"),
        callbackKey: 'callback',
        reader: {
            type: 'json',
            rootProperty : 'chamados',
            successProperty: 'success'
        }
    }
}});

Here is where i call the store to load (CONTROLLER)

showListaChamados: function (direcao) {
    this.cleanApp();
    store = Ext.getStore('Chamados').load();

    store.load({
        scope : this,
        callback : function(records, operation, success) {
            ***IT BREAKS HERE ON RETURN*** 
            Ext.Msg.alert('Opps', records[0].data.nom_usuario, this);
            Ext.Viewport.animateActiveItem(this.getChamadoView(), this.getSlideTransition(direcao));
        }
    });
    Ext.Msg.alert('Opps', store.data, this);

}

Here is the model

Ext.define('WE3Chamados.model.Chamado', {
extend: 'Ext.data.Model',
config: {
    fields: [
         {
            name: 'cod_chamado'
         },
         {
            name: 'nom_chamado'
         },
         {
            name: 'des_chamado'
         },
         {
            name: 'cod_equipe'
         },
         {
            name: 'dat_cadastro'
         },
         {
            name: 'dat_previsao'
         },
         {
            name: 'dat_necessaria'
         },
         {
            name: 'num_prioridade'
         },
         {
            name: 'cod_projeto'
         },
         {
            name: 'nom_usuario'
         },
         {
            name: 'cod_status'
         },
         {
            name: 'nom_projeto'
         },
         {
            name: 'des_equipe'
         },
         {
            name: 'nom_status'
         },
         {
            name: 'nom_cliente'
         },
         {
            name: 'cod_usuario'
         },
         {
            name: 'cod_usuario_responsavel'
         }
    ]
}});
4

1 回答 1

0

I found the problem, it was in the localStorage.getItem("usuarioId") its not sendind it by the get, because it is after login, i think there is a bug in the js or its so fast that the comand to send the link cant get the localStorage.getItem.

Im trying using php SESSION now.

于 2013-04-11T11:11:25.803 回答