ColReorder 1.1.0 throws error on dragging (aaData source) :: DT 1.10.0-rc

ColReorder 1.1.0 throws error on dragging (aaData source) :: DT 1.10.0-rc

hgabreuhgabreu Posts: 6Questions: 1Answers: 0
edited April 2014 in ColReorder
ColReorder is throwing an error when I drag any column:
[code]Uncaught TypeError: Cannot read property 'splice' of null[/code]

Here's the link to an example page showing the problem:
https://googledrive.com/host/0BxfBwM8xuKeSdUFMQVQyVGlGS2M/

Not sure if it's relevant, but my data source is an array of arrays.

The relevant part of the unminified code is near line 259 (dataTables.colReorder.js):
[code]
/* Array array - internal data anodes cache */
for ( i=0, iLen=oSettings.aoData.length ; i

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Hi,

    I believe that this has been fixed in ColReorder 1.1.1-dev already - but not yet released (with be will to DataTables 1.10). Can you try the latest code from here please: http://datatables.net/download/build/dataTables.colReorder.nightly.js?_=bd90119aa63b678571ebe289ff5697f7 - which contains that fix.

    Allan
  • hgabreuhgabreu Posts: 6Questions: 1Answers: 0
    Hi Alan,

    Yes, it is fixed. Thanks.

    But the same error happens if I pass a reorder array. Either using Dom initialization or new.
    [code]
    $('#myTable').DataTable({
    //other parameters ...
    'dom': 'Rlfrtip',
    'colReorder': {'order':order},
    });
    [/code]

    You can check the whole code on same link (now using colReorder nightly): https://googledrive.com/host/0BxfBwM8xuKeSdUFMQVQyVGlGS2M/

    Sorry for the trouble.
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Excellent - thanks for the test case. I've committed a fix here: https://github.com/DataTables/ColReorder/commit/83abe1d53 .

    The nightly is now up to date, although it is cached so you might need to modify your include URL for the nightly, or download the nightly to your local server.

    Allan
  • hgabreuhgabreu Posts: 6Questions: 1Answers: 0
    Thanks Allan, it worked great.
This discussion has been closed.