Bug in _fnReOrderIndex: Attempts to split() an array

Bug in _fnReOrderIndex: Attempts to split() an array

DigicratDigicrat Posts: 3Questions: 0Answers: 0
edited February 2013 in Bug reports
I am using 1.9.4 and server-side processing. If the server returns the columns in a different order than that specified in the table, _fnReOrderIndex() is called and throws an exception when it attempts to split sColumns (an array) into an array (line 341).

As a quick fix I changed that to the following -- though aColumns can be outright replaced with sColumns if it will always be an array.

[code]
var aColumns;
if ($.isArray(sColumns) ) {
aColumns = sColumns;
} else {
aColumns = sColumns.split(',');
}
[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    `sColumns` in the result from the server is deprecated and is removed in DataTables 1.10 (when it is released).

    I'd suggest using mData if you can - its more flexible and will give a performance benefit as well since the arrays don't need to be reordered.

    Allan
This discussion has been closed.