Large table loading

Large table loading

vigdalvigdal Posts: 7Questions: 0Answers: 0
edited July 2009 in General
Hi

In my project, i have to load a big table of datas.
In the table i have some hidden columns.
When i load the table in firefox, the table is firstly loaded and displayed with the "hidden columns" showed. Once loaded and dispplayed the process is running and after the data are sorted, the data is displayed again with "hidden columns" hidden.

I tried to use the bprocessing property, but this seems no to be used for the first loading of the table.

So, how can i do to display the table only after the datas are sorted, filtered, paginated?

Thank you for your answers.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Hi vigdal,

    The problem you are seeing is that the HTML must completely load before DataTables can actually read the data. With a large table this can be quite noticeable. There are a number of ways to get around this:

    1. Load the data using Ajax (which will cause DataTables to actually create the table elements)
    2. Use server-side processing (which if you are using 1000+ rows might be quite appealing)
    3. Load just part of the data into the HTML and then 'enhance' the table with the full data using a JS array (aaData) for DataTables.

    The downside to each of these, is that people without Javascript will not get the full data unless you add appropriate controls.

    You might be interested in this thread: http://datatables.net/forums/comments.php?DiscussionID=360

    Regards,
    Allan
  • jamescjamesc Posts: 4Questions: 1Answers: 0
    Hi, reviving an old thread here:
    Similar to the original poster, I want to load datatables with an HTML table, and not use server-side processing or ajax. When I load the table, I see the HTML table and then it suddenly clicks into place when the document is ready with the datatables page architecture. I'm not asking how to move to ajax/server side processing. I also must have the table fully visible for those who don't have javascript (hence wanting to do this just on an HTML table). What I want is when the page starts to load, it doesn't show the table until after the datatables javascript has been applied. Maybe I could, in javascript, hide the table then once loaded unhide it? Any suggestions?


    -JamesC
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I think your idea to hide the table is the way to go (and it won't affect people not using javascript).

    consider putting something in the table's place so user sees that the page is processing something

    try:
    [code]
    $('#example').hide();
    $('#example').dataTable();
    $('#example').show();
    [/code]
This discussion has been closed.