1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    183
    Vote Rating
    0
    deitch is on a distinguished road

      0  

    Default Persist Store to server?

    Persist Store to server?


    So I have been looking at the Store, and wondering if it is really one-way only, or I am missing something. Specifically, I can easily define a Store, have it load up its data via an HttpProxy (or some other), and interpret the data via a Reader class.

    Now I am trying to do the reverse. Throughout any user interaction, it is possible (likely?) that the data in the Store will be changed. Simplest example is an EditorGrid, where text data is changed. Now we want the reverse: a relatively simple way that the data in the grid can be *sent* to the server, mirroring the read.

    I didn't see this anywhere. The only thing I could see was to separately extract the data from the Store, then send it using Ext.Ajax or the like. Is there some method in store to persist it? Obviously, there are some complex questions around it. We would need something like the following on the store:
    • writer - config: a Writer object that defines how to convert the objects into a raw format understood by the server and transmittable via HTTP.
    • writeUrl - config: a url that is used to POST the data
    • write(boolean changes) - method: to use the writer to write the data into a format that can be POSTed. changes determines if we transmit changed data only or all data.

    Of course, the manner of POSTing opens a can of worms, since each server side process can use different formats. Nonetheless, if there isn't one there now, I would assume that it is better to have something decent rather than nothing? Besides, all that can be built into the Writer.

    Is there something in place or in the works for this?
    Thanks.

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    There is nothing built in, but a search of this forum and the Examples forum should give a number of threads that discuss options for doing this.

  3. #3
    Ext User
    Join Date
    Aug 2007
    Posts
    183
    Vote Rating
    0
    deitch is on a distinguished road

      0  

    Default Some, not much

    Some, not much


    Thanks, Tim. I found some stuff around xmlSerialize, as well as some around saving the state of the grid itself, but nothing direct.

    Anything hidden in 2.0, or is this a call to try and create it?

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    AFAIK know there is not. My thought would be that b/c the implementation would be so back-end and application-specific, that it wouldn't be worth trying to build a generic method.

  5. #5
    Ext User
    Join Date
    Aug 2007
    Posts
    183
    Vote Rating
    0
    deitch is on a distinguished road

      0  

    Default Well, I will try

    Well, I will try


    I need to create a persistence engine for my store anyways. Might as well try to make it as generic as possible. If it ends up being remotely close enough to worth posting, I will definitely share.

    What is the standard process for doing so? Just post it here?

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    In the User Extensions forum.

  7. #7
    Ext User
    Join Date
    Aug 2007
    Posts
    183
    Vote Rating
    0
    deitch is on a distinguished road

      0  

    Default Doh!

    Doh!


    Look before you ask, right?

    Thanks, Tim.

  8. #8
    Ext User
    Join Date
    Aug 2007
    Posts
    183
    Vote Rating
    0
    deitch is on a distinguished road

      0  

    Default Someone at least thought of it

    Someone at least thought of it


    If you look at the source to Ext.data.Store, there are parallels to load and loadResponse with update and updateResponse. They are blank, though, and no mention in 2.0 either. I will keep plowing ahead...

Thread Participants: 1