views:

745

answers:

3

I am currently implementing a YUI datatable as a reusable viewer to show sales reports (and other such things) for internal use. The problem is, many of these reports are up to, and even more than 1000 rows long, and client-side performance becomes an issue on even newer, faster machines.

For a variety of reasons, server-side pagination is not an option for us (mostly because it would be problematic when it comes to exporting a report to a spreadsheet -- you do not want the same paginated results).

So my question is.. in what ways can I increase performance on a YUI's datatable without resorting to server-side pagination?

+3  A: 

Here is one hint: Faster YUI DataTable with 5 Lines of Code

Eldar Djafarov
Interesting.. I implemented this tweak -- seems to improve performance a little. it seems to break initialLoad:false..
Stephen J. Fuhry
+1  A: 

Perhaps you could still use pagination when displaying result to a user, and when it comes to exporting it will load all not loaded yet rows?

Ray
I am thinking of trying this too.. I'm not overly excited about the idea of not having all my results in one screen, but if i can't get better performance without pagination, I may have to resort to client side pagination.
Stephen J. Fuhry
+4  A: 

What you want is client side pagination. The largest impact DataTable has on the UI is in the render phase. Tables are very complicated for browsers to render even by themselves. Add all the dynamic functionality available in DT and you can see some real UI lag.

Send all your data to the client. With client side pagination, the UI is more responsive and user friendly.

If this is not an option, configure renderLoopSize to around 200 or 300. This will chunk the output of the rows to 200 or 300 at a time, limiting the number of reflows that your page will suffer.

Luke