Results 1 to 3 of 3

Thread: Write event for

  1. #1
    Ext User
    Join Date
    Aug 2010
    Vote Rating

    Default Write event for

    Hello to all,

    I have a Store with a write event listener like this:
    var jsWriter = new{
    returnJson: true,
    writeAllFields: true

    var jsReader = new;

    var store = new{
    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

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    The Netherlands
    Vote Rating


    That's still something that has to be fixed.

    During processing, Ext removes each element from the 'rs' array.

    The fact that you see an empty array actually means all records were processed correctly.

  3. #3
    Ext User
    Join Date
    Aug 2010
    Vote Rating


    Hello Condor,

    I almost forgot to update this thread.
    I imagined that

    I have found a workaround in the meantime that works ok.

    I have made a private variable and I keep the getModifiedRecords() of the store.
    When the time comes that I want to process the records I access that variable instead of the rs.

    Additionally I have found that the records coming back from the server inside the server's response must have the same exact order as the client transmitted, otherwise the store changes positions of the records. This could produce several problems if you expect to find something specific always at position 1, 2, etc...

    Thank you again

Similar Threads

  1. Store write event not firing
    By bocockli in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 27 Mar 2012, 7:25 AM
  2. CRUD Store write event not firing
    By Greffin in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 18 Aug 2010, 6:34 AM
  3. Replies: 0
    Last Post: 28 Jan 2010, 7:09 PM
  4. [UNKNOWN][3.0.3] FUD regarding "write" event
    By ThorstenSuckow in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 4 Jan 2010, 6:34 AM
  5. RESTful store write event
    By cripkd in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 28 Oct 2009, 12:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts