paulopmx / Flexigrid

Lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml/json based data source using Ajax to load the content.
689 stars 539 forks source link

How to deal with big data? #115

Open chinimei opened 11 years ago

chinimei commented 11 years ago

Suppose i have 100,000 data line to render. All these data are stored on client. If i use paging, actually 1 page data is enough. Is there a way to avoid such big data transfer? Maybe sort will be influenced.

paulopmx commented 11 years ago

The solution is not to store data on the client. fetch it from the server on a per page basis.

On Aug 30, 2013, at 3:29 PM, chinimei notifications@github.com wrote:

Suppose i have 100,000 data line to render. All these data are stored on client. If i use paging, actually 1 page data is enough. Is there a way to avoid such big data transfer? Maybe sort will be influenced.

— Reply to this email directly or view it on GitHub.

chinimei commented 11 years ago

Currently is there a way to modify page count and current page number?

paulopmx commented 11 years ago

Yes. It's base on the json data you passed to it.

modify the json data then trigger flexReload

On Aug 30, 2013, at 3:43 PM, chinimei notifications@github.com wrote:

Currently is there a way to modify page count and current page number?

— Reply to this email directly or view it on GitHub.

chinimei commented 11 years ago

You mean I pass json like this.(page size 100) page 10 total 100,000 (rows) rows from 1000 to 1100, Is rows O.K? Because Flexigrid only get current page's row id. Don't know other page's row id.

conchilin commented 10 years ago

Hello. I am new to Flexigrid. I am very interested in this topic to handle large numbers of records and I would like to guide me in this.

paulopmx commented 10 years ago

If you set Flexigrid to handle 15 items per page, then you only need to passed 15 items. You don't need to pass the whole 100,000 rows, just the records specified for that page.

conchilin commented 10 years ago

Thanks for responding. It has helped me a lot this grid. Thank you!

vernmic commented 10 years ago

how you figure out what rows to return is server side or db side in the database you can create a stored procedure that accepts pagenumber and pagesize as parameters add a rownumber() column to your dataset select where rownumber between pagesize * pagenumber and pagesize * pagenumber + pagesize this is most efficient because it limits the data at the source. or on your server ajax handler for example in linq.net (from a in db.table select a).skip(pagesize * pagenumber).take(pagesize); this is less efficient cause your returning 100k rows to your webserver then only selecting one page worth to return to your ajax call.