2
votes

How to get all records from store when pagesize given? I am using Extjs 5.1.1. I couldn't find any solution that works for my requirement.

I can get by changing the pagesize of store and loading it so that all records will be in single page. But it will display all records in grid which is not desired.

I need a solution to get all records without effecting current state of grid.

For example, if grid with paging memory has currently pagesize 10 and total records 50. I want get all 50 records with out effecting current state of grid.

Thanks in adavance.

2
Make a second store and use that.Alexander
As I said before, I am using paging memory proxy. All records are at client side only. There is no need to request again and again while navigating to next page.Kalyan

2 Answers

2
votes

There is no handy way in Ext JS to operate with "out of the page" records since they are creating on-the-fly during proxy.reader.read() operation each time pagination occured (only for memory proxy, btw).

But there is a tricky solution. You could use this snippet to retrieve all records from memory store:

proxy.getReader().read(proxy.getData()).records

Simple example: https://fiddle.sencha.com/#fiddle/1ik2

0
votes

The grid will always show everything that is in the store.

A paged grid just tells the store which records to fetch from the server. While a certain page is loaded, only the records of that page are on the client, and the others are not.

You will have to create a second store, which fetches all the data at once.