colspan in tbody + FixedColumns

colspan in tbody + FixedColumns

emidlnemidln Posts: 2Questions: 0Answers: 0
edited June 2011 in General
So I have a table that wants some fancy features like scrolling, csv export, and copy/paste. I turned to datatables and it has worked out very well so far, but conceptually wanted to have an x-scrollable table that included subtotals. This seemed like a natural place for adding a th or styled td with a colspan equaling the number of fixed columns. This is an example
[code]


$(document).ready(function() {
var oTable = $("#foobartable").dataTable();
new FixedColumn(oTable, {
"iLeftColumns": 2,
});
});





Foo
Bar
Baz



datadatadata
datadatadata
datadatadata
subtotal header that requires two columnsdata
datadatadata
datadatadata


[/code]

The current behavior seems to fail to add the left columns as fixed and put everything to the y-scrollable right portion. Is this possible with the current DataTables and FixedColumns codebase? If it isn't, any pointers where I might start hacking at? It looks like _fnClone* family, but that's just a quick observation.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    [quote]emidln said: Is this possible with the current DataTables and FixedColumns codebase?[/quote]

    I'm afraid not - there is currently no support for colspan in the tbody in DataTables or any of its plug-ins. DataTables assumes (for filtering and sorting reasons) that there will be exactly rows x columns number of cells in the table. The closest you can get to what you are looking for with DataTables and FixedColumns at the moment is something like this: http://datatables.net/release-datatables/extras/FixedColumns/row_grouping.html

    Allan
This discussion has been closed.