Simply retrieving all records from a store
12,125
Solution 1
You can use store.getRange()
or you can use store.data.items
. For the getRange()
call, passing no parameters just defaults to 0 and the last record in the store.
Solution 2
I think this is not complete true, since getRange()
will retrieve all the records from a store first page.
If your store has pages of 50 records per page, then store.getRange()
will give you only the first 50 records.
Solution 3
This will reload the store with all records:
store.load({start:0, limit: store.totalCount, page:1});
Take all records from store:
var records = store.getRange();`
Related videos on Youtube
Comments
-
Clay Banks almost 2 years
Instead of retrieving a single row of data from my store, how can I modify the following code to retrieve all records?
var store = Ext.data.StoreManager.lookup('MyStore'); store.setProxy({ type: 'pagingmemory', data: store.getAt(0) }); store.load();
Any thoughts?
-
Clay BanksThis worked! You, sir, are a genius.
-
Clay BanksThrow it in an answer so I can give a an upvote!
-
Jeff Shaver
store.getRange()
should work or you can dostore.data.items
. For thegetRange()
call, passing no parameters just defaults to 0 and the last record in the store.
-
-
LeoSarena over 10 yearsThanks I had a checkColumn and I wanted to make only one checkbox selectable at a time. store.data.items worked like a charm.