PDA

View Full Version : Getting all records from Store



ahillman3
30 Jul 2009, 5:16 AM
I am migrating from GWT-Ext to GXT and need to know how to get all records out of a Store.

We do some client side validation prior to making server side calls to save changes, and many of those validation routines need to be able to see all the data on a grid. Only being able to get the modified records isn't adequate, as comparisons against the other existing rows needs to be done.

How do I get all records out of the Store?

Thanks,

Allen

sven
30 Jul 2009, 5:17 AM
store.getModels();

ahillman3
30 Jul 2009, 5:23 AM
Thanks for the quick response.

OK, after a quick look at the API, it appears Models are a more complete representation of the data than the Records. We don't actually use the getModifiedRecords since as stated above it doesn't help us.

I assume Models are the preferred method of looking at the data, what is the use case for Records now?

Thanks,

Allen

Colin Alworth
16 Aug 2009, 11:02 PM
From my understanding, Records store old data from models - when changes are made to a model in a Store, the Records track the old data so that changes can be reverted. If the changes made to a Store are commited, the Record purges the old data.

I mostly use them as a way to get metadata about a record - is it currently being edited (and so shouldnt be saved to the server)? Which fields have actually changed since last save (and thus are the only fields that the data store actually needs to see)?

Adding a question of my own to the thread, why is the Store reference marked transient? (private transient Store<ModelData> store; ) The class is never serialized, so it shouldnt matter, or does this provide some other benefit?