26 Nov 2013 1:50 AM #1
PagingToolbar Problem in Loading Huge datas
I am developing an application in ExtJS.I am using grid to display records.The Grid is loading 1200k
row of datas from a table in database.So that i used PagingToolbar.I set the "limit" to "200".when
clicking "Next" button it loads the next "200" records.But when clicking "Last page" button my application is crashed and takes full system memory.While looking at "Ext.PagingToolbar" source "moveLast" function gets the totalcount from the database.This seems to be the problem.how can i change this code?Could you please help me to fix this issue?
3 Dec 2013 12:54 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Loading 1,200k or even 1,200 records is not recommended, you need to only load 1 page at a timeMitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
11 Dec 2013 2:01 AM #3
Thanks for your reply michellsimoens.In our application we are using pagingToolBar.It seems that it loads all the records from db when we click on the navigate to last page button, when the number of records has been increased and If we try to navigate to the last page the application crashes because of the component loads all the records into the memory. We need your help to know is there any possility to restrict the component to load only the last page records instead of loading all the records in memory. It will be grateful if we get any solution or workaround to resolve this behavior.Thanks in advance.
12 Dec 2013 1:37 AM #4
As far as I understand you load all the records from the database and you set totalcount. Then you expect ExtJs will page your records. This is wrong.
If you load 25 record per page load just 25 records on the server side and then set totalcount to all the record in the table. This way your server side will manage paging.
I have several hundreds grids working perfectly with filters and sorting incuded.