FixedColumns sorting bug on jQuery UI themed table

FixedColumns sorting bug on jQuery UI themed table

natebeatynatebeaty Posts: 15Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
I am attempting to implement FixedColumns and it seems to fail with the latest DataTables build. When clicking any sort header it doesn't properly update the header styling, the fixed column's elements don't reorder, and I see a js error in console:

[code]Uncaught TypeError: Cannot read property 'className' of undefined FixedColumns.js:796[/code]

I was going to send a link but noticed you have the exact same behavior on your example page: http://datatables.net/release-datatables/extras/FixedColumns/themed.html

Any help would be much appreciated.

Thanks!

Replies

  • natebeatynatebeaty Posts: 15Questions: 0Answers: 0
    Just curious if anyone else has addressed this issue.

    I can get rid of the className error by commenting out a few lines, but obviously it still doesn't copy the jQuery UI styles across.

    It also doesn't update the order on the fixed column items, so I figure there's more to it than just the class issue. I'll poke around more and see if I can pinpoint the other areas of failure.
  • natebeatynatebeaty Posts: 15Questions: 0Answers: 0
    I guess the answer for now might be to avoid using jQuery UI on the table, which we don't even really need. (Was just using it for a quick mockup, and somehow it made it into the final code months later.)
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Try using the nightly version of FixedColumns. That should work with jQuery UI.

    Allan
  • natebeatynatebeaty Posts: 15Questions: 0Answers: 0
    Hi Allan,

    Thanks for the quick response!

    The nightly build does indeed fix the above issues, but I still see one small bug remaining:

    [code]aria-sort="ascending"[/code]

    remains in the even as you click on other headers, which we're using to style the currently sorted header (since class="sorting_asc|desc" isn't available with "bJQueryUI": true).

    I believe the aria-sort attribute should be removed when you click on other headers, and should toggle from aria-sort="ascending|descending" if you click the FixedColumn header.
  • natebeatynatebeaty Posts: 15Questions: 0Answers: 0
    I believe all that is required to fix this is adding:

    [code]
    aoFixedHeader[i][j].cell.setAttribute('aria-sort',aoCloneLayout[i][j].cell.getAttribute('aria-sort'));
    [/code]

    to line 910. That seemed to do the trick for me, and doesn't raise errors when bJQueryUI is false.
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Thanks - I'll look into this.

    Allan
This discussion has been closed.