Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82012

Real-time DOM pagination on client-side possible ?

$
0
0
Hello,

I am currently building a JavaScript web application which uses jQuery DataTables. The data is first bootstrapped from the server into javascript objects and then for all tables in the application, the HTML table is generated as DOM and the function datatable() is applied on each of them . Very often, tables are destroyed,reconstructed, filtered, re-styled on the fly as the user plays with the various controls and all goes very smoothly. At times there are long running scripts but these are handled easily with setTimeouts applied to break up long loops.

It all goes well until one of the tables had to return 5000 rows. On recent versions of Firefox and IE, it takes approximately 7 seconds to get the datatable initialized which is quite tolerable. However, the target browser for this app is Internet Explorer 7 and after 5 seconds of processing I get the error 'stop running this script' which eventually crashes the browser.

Since the application is pure JavaScript on the client side, I cannot afford to go for a server datasource which would completely go the opposite way of a pure js client. I've also tried to optimize the tables with bSortClasses : false and bSort : false, etc, etc... to no avail. What I usually do when I get that error in iE7 is breaking the long loops with a setTimeout to let the browser 'breathe' but looking at the DataTables API, I can't seem to find where to start.
Any ideas?

I was wondering if there could be a plugin out there which does real pagination on the client side, that is, for instance, load the 100 first rows (which would take 1 split second) and then when the user choose a higher pagination number then the dom would be instantiated only when necessary. It would therefore works a bit like the server-side implementation, only that it is client-side. Any thoughts?

Thanks,
Jimmy

Viewing all articles
Browse latest Browse all 82012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>