Is it possible to use ColReorder in conjunction with footerCallBack?

Is it possible to use ColReorder in conjunction with footerCallBack?

WillianRobyWillianRoby Posts: 3Questions: 2Answers: 0

In a table, I have the footerCallBack added, but after starting to use ColReorder, report this error on the console: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.

I've been researching the error and I verified that it is because the footerCallBack generates a "colspan" and with colspan it is not possible to use ColReorder.

Is it already possible to solve this problem?

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    Here is an ColReorder example with footerCallback. Note the example has one th for each column. it also uses colReorder.transpose() to get the reordered index.

    I believe you will need to remove the colspan and have one th for each column.

    Kevin

  • WillianRobyWillianRoby Posts: 3Questions: 2Answers: 0

    I understood! But is it really not possible to use the Colspan attribute in conjunction with ColReorder? I need to use Colspan.

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    My guess is ColReorder doesn't analyze the footer and expects a one for one thead and tfoot mapping. Datatables does require unique th for each column in the header. See this example for detauls.

    One option might be to create the footer after Datatables initializes. Datatables won't know about the footer and ColReorder won't affect the footer. See this example:
    http://live.datatables.net/fatalohu/1/edit

    However the column().footer() API and using footer: true with the export Buttons won't work. You can use messageBottom as shown in this example to show your footer calculations.

    Kevin

This discussion has been closed.