0
votes

my call to store.load never return to the callback function. If this store is defined in a grid, the message "loading.." never disappears.

myStore.load({
        callback: function () {
            alert('returned');

        },
        params: {'person':1, 'datePost':calendarPost.getValue()}

    });

No errors are displayed, the server (rails) do its job with no errors.

I already try to add a "failure: function", but it´s not called also.

This is my store definition:

var myStore = Ext.create('Ext.data.Store', {
model: 'App.model.Post',
proxy: {
    type: 'ajax',
    format: 'json',
    url: 'posts/build_posts',
    actionMethods :{
        read   : 'POST'
    }
}
});

This is the (real) data returned from the server:

[
{"chegada":null,"consulta_id":null,"convenio_id":1,"data":"2012-11-13","encaixe":false,"hora":"2000-01-01T08:00:00Z","id":40031,"inicio_consulta":null,"medico_id":1,"observacao":null,"paciente_id":1948,"tipo":1},
/* Took out similiar ones */
{"chegada":null,"consulta_id":null,"convenio_id":null,"data":"2012-11-13","encaixe":false,"hora":"2000-01-01T09:15:00-02:00","id":null,"inicio_consulta":null,"medico_id":null,"observacao":null,"paciente_id":null,"tipo":null},
/* Took out similiar ones */
{"chegada":null,"consulta_id":null,"convenio_id":52,"data":"2012-11-13","encaixe":false,"hora":"2000-01-01T14:00:00Z","id":40042,"inicio_consulta":null,"medico_id":1,"observacao":null,"paciente_id":1732,"tipo":1}
/* And so on.. */
]

and this is my model definition:

Ext.define('App.model.Post',{
    extend: 'Ext.data.Model',
    fields: ['id', 'hora', 'data','chegada','tipo','encaixe','nome','paciente_id','consulta_id','inicio_consulta','convenio_id']
});
1
Any errors? It sounds like your reader can't properly read the result returned from the server. That will end up in this situation. Can you post the result that get returned by the server please. - sra
Ok, I updated my post. thanks - Beetlejuice
Some of your returned id's are null. The idProperty should not be null. And please don't post such huge amounts of data. I shortened it a bit. - sra
I removed all null records and the problem remains. - Beetlejuice

1 Answers

0
votes

I got the problem. It was missing a Ext.require('App.model.Post'); in my js file.

No error messages make hard to code.