Colreorder does not work when data is add using dataTable.rows.add(data);

Colreorder does not work when data is add using dataTable.rows.add(data);

RSiebelingRSiebeling Posts: 10Questions: 0Answers: 0
edited February 2014 in DataTables 1.10
Hi,

Colreorder doesn't work when data is added using dataTable.rows.add(data);
When the data is added in HTML colreorder works fine.

I've created an example where this is happening (the Colreorder plugin doesn't work in my browser in JSBin, but it works on my own server).

http://live.datatables.net/voy/1/edit

When the columns are dragged to a new place, the data from the first rows (which were added in the HTML string) are dragged as they should be, but the data that has been added using the rows.add function aren't moving.

This seems to be a bug...
Could you please help?

thanks in advance,
Richard

Replies

  • RSiebelingRSiebeling Posts: 10Questions: 0Answers: 0
    edited February 2014
    Oh I see that datatables.live doesn't automatically add the Colreorder plugin... please add it to see the behaviour as described above (I hope the colreorder plugin works in JSBin in other browsers than Safari on a Mac)
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Interesting - thank you for this. I'll take a deeper look into what is going one at the start of the week.

    This is my slightly update to your script for initial testing: http://live.datatables.net/voy/3/edit .

    Allan
  • RSiebelingRSiebeling Posts: 10Questions: 0Answers: 0
    Ok, great, I'll be looking forward to the solution / bug fix,
    Richard
  • RSiebelingRSiebeling Posts: 10Questions: 0Answers: 0
    Hi Allan,

    do you have any clue what's happening here?
    thanks,

    Richard
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Sorry - I've not been able to create time to look at this yet. It is on my to-do list.

    Allan
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Think I've found the error in ColReorder thanks to your test case. Could you try the nightly from the download page: http://datatables.net/download/ ?

    Thanks,
    Allan
  • RSiebelingRSiebeling Posts: 10Questions: 0Answers: 0
    Hi Allan,

    it works like a charm, thanks,
    Richard
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Great - thanks for letting me know. I'll release the fix alongside DataTables 1.10.0.

    Allan
This discussion has been closed.