Pagination with page selection from document url.

Pagination with page selection from document url.

jurgenfdjurgenfd Posts: 4Questions: 0Answers: 0
edited June 2009 in General
Hi guys,

Forgive me if this was detailed already but I didn't find it on this forum before.

I would like to use paginated tables. The reason I would like to do this is to speed up the rendering time
of a long table.

http://nmr.cmbi.ru.nl/eNMRworkshop/data/AS/BASPParis/BASPParis.cing/BASP/HTML/Restraints/it8_ambig_tbl.html#_o15328

The only reason that I can not, is because I need to be able to link from another side to a specific row in the long table as examplified by #_o15328 in the above url.

E.g. the other side being the first cell (with id 1036.00) in the first table on the right at:
http://nmr.cmbi.ru.nl/eNMRworkshop/data/AS/BASPParis/BASPParis.cing/BASP/HTML/Molecule/A/LEU26

Is there a way to do this or is there an easy way to speed up the rendering in a different way.

The data are static so I can't do this with server side requirements.

Thanks,
Jurgen

Replies

  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    Hi Jurgen,

    Ah a tricky one :-). Okay here is what I would recommend as the best way to speed this up:

    1. Put the first 10 rows of the table into the html so there is at least something on the page
    2. Load the full table via sAjaxSource (ie XHR).

    The result of this is that when DataTables is initialised it will put the fill information from the server, and replace when it currently in the document, with it's new data.

    How does that sound?

    Allan
  • jurgenfdjurgenfd Posts: 4Questions: 0Answers: 0
    So that would speed up the rendering time without resorting to pagination. Ok, I'll look into the sAjaxSource thingies and see if I can pull in cells with complex html markup.

    I would be afraid the user experience is still disrupted however since she will wait for several seconds on a screen that shows an unexpected result. She might back out...

    Perhaps I should revisit your various general tips in this forum on speed improvements.

    Thanks for the suggestion though. There might be no pleasing me;-)
  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    You are correct in that there is no 'perfect' way of doing this other than to have the table fully set up for the Javascript options that DataTables added at page load time. Progressive enhancement often has this problem, and part of the hardest bit of making a web-site with progressive enhancement is to keep the transition from the non-JS version to the JS enhanced version smooth.

    There are a few things you can do to speed things up, such as disabling the sorting classes, using $().ready on the table ID rather than document etc. It might be an idea to use the Webkit or Firebug tools to find out exactly what is going on and how you can speed things up. gzip for your documents from the server for example can make a huge difference.

    Regards,
    Allan
This discussion has been closed.