Is it possible to use ColReorder in conjunction with footerCallBack?

Is it possible to use ColReorder in conjunction with footerCallBack?

WillianRobyWillianRoby Posts: 2Questions: 1Answers: 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 an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 13,114Questions: 25Answers: 3,080
    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: 2Questions: 1Answers: 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: 13,114Questions: 25Answers: 3,080

    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

Sign In or Register to comment.