PDA

View Full Version : Store with no pageSize



radutoev
18 Nov 2011, 12:25 AM
Hello,

I am using ExtJS with JAVA as a backend technology.
I want to populate a grid panel with all data that I have in the database, however I saw that the default page size for a store is 25.
Is there a way to remove the limitation and make a call so as to retrieve all available data?

Thanks.

tobiu
18 Nov 2011, 1:41 AM
loading data without any limit is quite dangerous.
you should always set one, even if it is extremely high.

i am not sure if you can bypass it completely, depends on the ext js version you use (wrong forum here!). you should take a look at the sources:
http://docs.sencha.com/ext-js/4-0/source/Store2.html#Ext-data-Store-cfg-pageSize

radutoev
18 Nov 2011, 1:47 AM
I am using ExtJS4.
The server side is really complex and a lot of processing happens on a request before the data that will be displayed is available. As such each time I would call for a new page of data will result in running the processing steps again, which I do not want to do.
Also I don't want to keep the results on the session.
Also, why do you say that returning all the results would be dangerous?

flanders
18 Nov 2011, 4:25 AM
Loading without paging is dangerous because you take the risk of asking for milions of records, reducing performance to unacceptable levels at the frontend. (And most likely break your browser)

If you are sure that this is not an issue, you can set the pageParam of your proxy to undefined. (According to the documentation here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.Ajax)

radutoev
18 Nov 2011, 4:34 AM
Thanks for the answer.