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?
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...