Pre-rendered FixedColumn tables?

Pre-rendered FixedColumn tables?

seujseuj Posts: 3Questions: 0Answers: 0
edited July 2012 in DataTables 1.9
I've been having a go at integrating the rather excellent DataTables and the FixedColumns extra into a set of (somewhat) large tabular reports that we deliver within our web application.

I'm wondering if anyone has previously thought about a way to alleviate the additional JavaScript processing overheard that this extra brings? Once the processing is finished, the performance of fixed header and column scrolling is very acceptable, but the initial loading time is of course huge on multi-hundred-row tables.

Using our reporting application, I'm able to pre-render almost any configuration possible, eg by creating the separate top, left and content s, as well as being rigorous enough in the CSS to use a fixed-layout table and fixed column widths.

So my question is would it be possible to turn off the processing aspect of FixedColumns in the same way that you can set, say bAutoWidth = false in DataTables itself?

Many thanks for any advice here.

Replies

  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin
    There are two things that really slow FixedColumns down:

    1. Clone the whole drawn table and then manipulating the DOM
    2. Matching row heights

    These have to happen every time a table is redrawn (to take account of sorting, filtering etc)

    The second one has, I think, the biggest impact, but can be alleviated to some extent by using sHeightMatch: none and using CSS row height matching: http://datatables.net/release-datatables/extras/FixedColumns/css_size.html .

    The cloning of the table however, I've yet to find a better way of doing that, and any suggestions are welcome!

    Allan
  • seujseuj Posts: 3Questions: 0Answers: 0
    Many thanks allan, I'll have a look into the cloning aspect (I'm already using sHeightMatch)!

    On a side note, I'm still noticing that my column widths are being altered by DT, even though I have bAutoWidth set as above (but only when FixedColumns is invoked). Is this intended behaviour? This is most obvious when a table has a width shorter than 100% of the containing view, but occurs at all other widths to a lesser extent.

    What is DT/FC trying to fit to here? I have sScrollX set to an exact width as, again, I know the output of my tables and widths of the columns. Perhaps this could also follow the bAutoWidth setting?

    Thanks again for a great library, appreciate the hard work.

    Cheers,
    -Will
  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin
    To some extent the width matching is required (otherwise you might get a gap between the fixed column and the rest of the table) - however, you might want to try using FixedColumns 2.5.0.dev from git ( https://github.com/DataTables/FixedColumns/blob/master/media/js/FixedColumns.js ) and see how you get on with that. I've made a number of changes to how the script works (scrolling over the whole table now, not just the non-fixed part).

    Allan
  • seujseuj Posts: 3Questions: 0Answers: 0
    Thanks Allan! Will do.

    I can see how for most fluid tables, width matching is essential, however for a very careful fixed design with no white-space wrapping and content in every cell (to ensure styled height), it would be an interesting optimisation. Just my vote, anyway! :)
This discussion has been closed.