PDA

View Full Version : using xml store to write out modified xml



integration_tester
2 May 2014, 11:18 AM
hey all, i have a few questions about using xml with extjs 4.x:

1) is it possible to have a different proxy for reading and writing?

2) is it possible to get a reference to the local version of modified xml?

lets say that i have a model instance of some store that was loaded using xml.

if my model instance variable is named 'record':
i can do record.raw to get the xml that was used to create this specific record.
now if i do

record.set('somefield','somevalue');
record.commit();

should i expect the xml accessed by record.raw to have changed?

if not, what is record.commit(), or record.store.commitChanges(), actually doing?

documents for commit say "Commits all changes made to the instance since either creation or the last commit " but what is the 'instance' in this case?

3) is there a way to get raw modified xml locally, or is this only done when .save() is called on the store?

thanks for any help.

mitchellsimoens
19 May 2014, 8:03 AM
1) No
2) record.raw is the raw data from when the record was first created with and will not be modified as you modified the record data. This is also removed from Ext 5.
3) Once the data is read by the reader, it is now JavaScript and we do not keep any xml. The Xml writer is only used when you want to update the server of any changes in records and will send Xml back.

integration_tester
19 May 2014, 9:08 AM
thanks for the response