FixedColumns doesn't restore header columns on when calling fnDestroy

FixedColumns doesn't restore header columns on when calling fnDestroy

dbrochudbrochu Posts: 3Questions: 0Answers: 0
edited July 2012 in Plug-ins
Hello,

I'm using DataTables x-axis scrolling & FixedColumns in conjunction with the Adapt.js grid layout (which determines CSS files to include based on the browser width). If my page is too narrow to see the whole table, I enable DataTable x-axis scroll and FixedColumns and fix the first and last column of the table. When the page resizes there's a callback function I use to resize the DataTable. Everything works great until the page width is so wide that the x-axis scrolling is not necessary. I call oTable.fnDestroy() but the first and last column of the header row do not reappear. Is there any workaround to this, or is there something other than fnDestroy() I can do in this scenario?

Thanks

Replies

  • allanallan Posts: 61,853Questions: 1Answers: 10,134 Site admin
    Could you try the very latest FixedColumns that is in Git please: https://github.com/DataTables/FixedColumns/blob/master/media/js/FixedColumns.js . This issue might be address by the rearchitecting of now FixedColumns works.

    If that doesn't help, can you post a link to a test case please.

    Allan
  • dbrochudbrochu Posts: 3Questions: 0Answers: 0
    Thanks for the quick response. I tried implementing the latest FixedColumns and it does seem to resolve the issue with destroying the DataTables instance. The fixed header columns now reappear correctly. However, the header columns no longer seem to match up correctly with their rows and I'm also seeing scrollbars in some cells of the fixed columns. I put an example at this URL:

    http://dev.givingdata.gitscloud.com/temp/fixedcols/default.html
  • dbrochudbrochu Posts: 3Questions: 0Answers: 0
    And here's a simpler non-resizable example which takes adapt.js out of the equation.

    http://jsfiddle.net/tBjys/
This discussion has been closed.