pouli
2 Nov 2010, 8:01 AM
Hello to all,
I have a Store with a write event listener like this:
var jsWriter = new Ext.data.JsonWriter({
returnJson: true,
writeAllFields: true
});
var jsReader = new Ext.data.JsonReader();
var store = new Ext.data.Store({
baseParams:
{
docID: docID
},
storeId: 'id',
proxy: proxy,
reader: jsReader,
writer: jsWriter,
remoteSort: false,
sortInfo: {
field: 'sortOrder',
direction: 'ASC'
},
autoSave: false,
listeners: {
...
write: {
fn: function( store, action, result, res, rs ){
....
}
The reader is configured from the server with the metaData element in the server response.
When I have an update action I want to read the data returned from the server.
This works ok when I change only one record.
For example I do rs.get('id') and it works fine.
But my problem starts when I change more than one records.
I see that the client sends 2 for example.
The server returns the correct 2 records back to the client but inside the write listener the rs.length is 0 !
Why is that ?
Possibly this means that the client was not able to parse the answer form the server ?
Why not undefined then ?
Thank you in advance
I have a Store with a write event listener like this:
var jsWriter = new Ext.data.JsonWriter({
returnJson: true,
writeAllFields: true
});
var jsReader = new Ext.data.JsonReader();
var store = new Ext.data.Store({
baseParams:
{
docID: docID
},
storeId: 'id',
proxy: proxy,
reader: jsReader,
writer: jsWriter,
remoteSort: false,
sortInfo: {
field: 'sortOrder',
direction: 'ASC'
},
autoSave: false,
listeners: {
...
write: {
fn: function( store, action, result, res, rs ){
....
}
The reader is configured from the server with the metaData element in the server response.
When I have an update action I want to read the data returned from the server.
This works ok when I change only one record.
For example I do rs.get('id') and it works fine.
But my problem starts when I change more than one records.
I see that the client sends 2 for example.
The server returns the correct 2 records back to the client but inside the write listener the rs.length is 0 !
Why is that ?
Possibly this means that the client was not able to parse the answer form the server ?
Why not undefined then ?
Thank you in advance