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();`
Share:
12,125

Related videos on Youtube

Clay Banks
Author by

Clay Banks

I created The Vurger App!

Updated on June 26, 2022

Comments

  • Clay Banks
    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 Banks
      Clay Banks
      This worked! You, sir, are a genius.
    • Clay Banks
      Clay Banks
      Throw it in an answer so I can give a an upvote!
    • Jeff Shaver
      Jeff Shaver
      store.getRange() should work or you can do store.data.items. For the getRange() call, passing no parameters just defaults to 0 and the last record in the store.
  • LeoSarena
    LeoSarena over 10 years
    Thanks I had a checkColumn and I wanted to make only one checkbox selectable at a time. store.data.items worked like a charm.