Hide DataTable until drawing complete

Hide DataTable until drawing complete

WayneWayne Posts: 2Questions: 0Answers: 0
edited February 2014 in General
I have spent an hour searching for a way to hide a datatable until drawing is complete. When about 1000 rows are displayed on my table you briefly see the underlying html table before that is replaced by the datatable. There are several techniques I could use for hiding the table but I would need to know when drawing is complete so that I could then make the table visible. Does anyone else see this brief flash of the html table and if so what can be done to solve the issue. Thx.

Replies

  • allanallan Posts: 51,467Questions: 1Answers: 7,761 Site admin
    You could put it in a hidden element, and then us fnInitComplete to make the element visible when the initialisation is complete.

    Allan
  • WayneWayne Posts: 2Questions: 0Answers: 0
    Somehow from reading other posts I got the idea that fnInitComplete wouldn't do the job. But it works like a charm. I should have tried it before posting, thanks for your patience.

    The page is now lightening fast, all the time must have been spent drawing the html table. Now with only the datatable being displayed it is lightening fast, even with 5000 rows! Great product!
  • allanallan Posts: 51,467Questions: 1Answers: 7,761 Site admin
    Part of the problem with this technique is that the table has no dimensions on initial draw - so if you have scrolling enabled, you must use call fnAdjustColumnSizing when the table is made visible. That's the most common issue with this technique.

    Allan
This discussion has been closed.