1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    24
    Vote Rating
    0
    atomcat is on a distinguished road

      0  

    Default alwaysPersist Ext.data.Field config

    alwaysPersist Ext.data.Field config


    In the Ext.data.Writer there is a writeAllFields config option. If it's set to false, only the updated fields of the models got propagated to the server side. This is very useful, cutting on the amount of data transferred, and making server side updates more easy and efficient.

    The problem is, that in some cases even though
    writeAllFields is set to false, some fields still might be needed to get propagated to the server side.

    Consider an optimistic locking solution, where the last version id is propagated to the client from the server side. As the data is saved back to the server, the server side must know the version id of the record to be updated to be able to identify dirty updates. If this data does not arrive, this task is not possible.


    I'd suggest having a config, that makes the field always persist, independent of the writeAll config setting of the underlaying writer class.

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    86
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    I agree with the suggestion. However, for the time being, it should be rather trivial to extend the Ext.data.writer.Json writer, modify getRecordData(), and implement the functionality you want.

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    24
    Vote Rating
    0
    atomcat is on a distinguished road

      0  

    Default


    Hi,

    Yes, that's what I'm doing at the time.

    But it would be better to have it in the framework, so everybody could use it the same way rather than having it implemented by everybody needing this feature... Guess that's one of the goals of feature requests.

Thread Participants: 1