DataTables does not cope with colspan

DataTables does not cope with colspan

RdeBoerRdeBoer Posts: 10Questions: 0Answers: 0
edited November 2013 in Bug reports
Thanks for this great library. Works a treat.

One quibble: DataTables does not seem to like colspans anywhere in the table. If the table has a td with a colspan attribute, you get:
"Uncaught TypeError: Cannot read property 'className' of undefined" (jquery.dataTables.js, line: #669)

I can understand that colspans are hard to deal with when sorting columns that go across a colspan. But sorting on other columns is theoretically possible, right?

Moreover, the above error also occurs when sorting is OFF. In other words the search-box/filter facility also breaks in the presence of a colspan.

I've been using v1.9.4 and the table below to reproduce this error:




Head1
Head2
Head3



Info
Drupal
7.23


OK
Access to update.php
Whatever...


OK
CTools CSS Cache
Exists


Warning
PHP_CodeSniffer not installed.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Not so much a bug, more a known limitation. Its unlikely in the near future support for colspan / rowspan in the tbody of the table will be added due to the complexity of dealing with hidden columns, column sorting, filtering, column filtering etc. It would likely require a lot of code to be added and significantly effect performance.

    Allan
  • RdeBoerRdeBoer Posts: 10Questions: 0Answers: 0
    Fair enough. I understand.
    So you wouldn't consider making it work when just the search-box is active and no other features?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Not at this time. It would either be a core part, or not at all.

    Allan
  • pborreggpborregg Posts: 59Questions: 2Answers: 0
    Allan, so what you're telling me is that there's NO way your DataTables can provide a solution with a TR that has a TD with a colspan of any number?

    This really causes us a big problem.

    Can you suggest anything?

    Thanks, Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    No sorry - this is simply not possible in DataTables at the moment. Adding such support would add a huge amount of code and complexity to DataTables, and at the moment I have other priorities.

    Allan
This discussion has been closed.