View Full Version : Display data before it is totally loaded

14 Jul 2009, 2:31 AM
Hello, I am a newbie. I have a table in which I want to display a lot of data. it is in PHP.
I want to improve the display and also the time of loading of the page. As we can use AJAX in ExtJS I think it's a good choice to use this.
So I have build my grid and retrieved data from the database. Everything works fine.
Now as the page's loading last about 30 seconds (5000 rows of answer even if I only display 10 lines in the grid with pagination), I wish I could display directly the lines that are already found in my database, step by step, a kind of "streaming".
I also need to do a filter box and I should be able to sort data, so I must load all data before I can use these functions. Can anyone help me what is the best solutions and how to do that ?
The goal is to improve the speed of loading.
Thank you!

14 Jul 2009, 6:35 AM
as keyword: dont load the full data from php but do the paging on the server. (server side paging)

maybe this gives you an idea:

21 Jul 2009, 5:21 AM
The problem is that the server still have to do all the calculations to have all the results of the query and finally execute the "LIMIT" part. So time of loading isn't decreased anyway.
The thing is that I cannot touch to this annoying query as it is part of a pre-existent project that is already broadcast to clients.
As far as I know, we can't retrieve data before the SQL statement has been totally executed, am I right ? So paging or not, it's impossible until the SQL statement is changed.

I also though about retrieving the data one time and then doing all the work client size. But it requires too much memory (about 3000 rows) and it may crash the navigator !

So, the solution I am about to choose is the LiveGrid component : http://www.siteartwork.de/2007/11/10/livegrid-component-with-extjs/

Instead of paging, the view buffers a specific number of records from the database. When scrolling, the position of the “cursor” changes and a request for new data will be send to the server, delivering an updated buffer with the data the new cursor position indicates.

I think I can't speed up the loading time but once data is retrieved I can speed up the display and the reactivity of the display.

If you have comments, observations, solutions or if I'm wrong don't hesitate to put comments !

Thanks a lot !

23 Jul 2009, 3:39 AM
I posted a possible solution to this problem on another thread.
Take a look at : http://www.extjs.com/forum/showthread.php?t=75143
Hope this helps.

23 Jul 2009, 3:42 AM
Yes, you could use the LiveGrid user extension or (in Ext 3) BufferView.

Another solution would be my PagingStore user extension for local paging.

23 Jul 2009, 3:45 AM
Thx Condor !