When adding and removing rows, they don't return to the same position

When adding and removing rows, they don't return to the same position

brynjolfbrynjolf Posts: 4Questions: 1Answers: 1

Hey,
First off, here is my JSbin

It features two datatables, one #main and one #edit. Per default I order them by Position. If I remove the employee Cedric Kelly, by a button using row.remove and row.add(data), then re-add Cedric, the row doesn't appear at the same position as before, now it is added to the end of the Javascript Developer sorting, after Raulie Pyrdie.

What I would expect to happen is that it goes back to the same spot as before the add/remove cycle.

Is this a bug or do I need to change something so this can be achieved? If I use multi-column sort it will fix itself but I would like the user to be able to order by one column and get the expected behaviour.

Thanks!

Answers

  • brynjolfbrynjolf Posts: 4Questions: 1Answers: 1

    Allan, I read the introduction again and apologize, didn't notice you wanted JSFiddle or your own hosted JSBin so in case you don't use JSBin.com I made a JSFiddle to make it easier for you :)

    https://jsfiddle.net/vctn1uu8/

    Thank you!

  • brynjolfbrynjolf Posts: 4Questions: 1Answers: 1

    Anyone have a clue how to solve this?

This discussion has been closed.