Sorting error on fnAddData

Sorting error on fnAddData

richcomptonWFrichcomptonWF Posts: 7Questions: 0Answers: 0
edited April 2014 in Bug reports
If there are multiple tables on a page, sorting one table can cause an issue with adding data to the other. The following case can illustrate the issue. Table1 has 3 columns and Table2 has 4 columns. Sort the 4th column of Table2 and attempt to add data to Table1. It will result in the following error: "TypeError: Cannot read property 'sSortDataType' of undefined". This is because it is trying to sort the 4th column, however Table1 only has 3 columns. This is recreatable using the multiple tables example, eliminating the 4th column from one of the tables, sorting the other and adding data to the first.

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    edited April 2014
    Can you link to a test case showing the issue please? I don't quite understand the exact situation - why is the second table trying to sort on a column that doesn't exist?

    Allan
  • richcomptonWFrichcomptonWF Posts: 7Questions: 0Answers: 0
    http://jsfiddle.net/UtCuB/

    If you click add it works as expected. Now cort the 4th column of the bottom table and click add.
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Looks like a bug in 1.9.4 :-(. On the plus side, it is fixed in 1.10 already: http://jsfiddle.net/UtCuB/1/ .

    Allan
  • richcomptonWFrichcomptonWF Posts: 7Questions: 0Answers: 0
    Would you have any idea on a fix in 1.9.4 for this? Unfortunately at this time we cannot yet upgrade to 1.10 due to the lack of update on certain plugins (mainly ColumnFilterWidgets).
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    I'd need to look into it. If you pick up an hour of priority support ( http://datatables.net/support ) I will do so when I get back into the office on Monday.

    Allan
This discussion has been closed.