PDA

View Full Version : Write ALL store records to the server



bkraut
1 Sep 2011, 10:14 AM
Hi,
I'm using restful stores to write to the server. I found a problem, where I have to commit ALL the records in the store not just those modified ones.

Why? I'm asembiling the record in java that sent to the ExtJs and displayed in the Extjs grid dynamicaly. Also the store gets the recordType dynamicaly.

When the rest PUTs or POSTs the data to the server, just modified records are sent. In my case I first delete all existing records and then store all submitted records due to the origin of the data structure (I can not update an existing record as it is assembled dynamicaly).

Is there a way to send all the records in the store? I checked the API and couldn't find something useful.
If not where is the best way to start the overwrite?

Tnx for any help.

hendricd
6 Sep 2011, 6:41 AM
@bkraut: Start with something like:



var recs = Ext.pluck(yourStore.getRange(), 'data');