row-reordered event issue

row-reordered event issue

ymolinetymolinet Posts: 2Questions: 1Answers: 0

Hi all,

I'm try to use row-reordered event to do some calculate on the data.
The event is fired, and call an external js function.
In this function, I call o.DataTable().rows();
The result is the data ordered as before the reorder, not after ...

How can I trigger an event after the reorder ?

Thanks,
Yannick

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    Answer ✓

    Interesting issue. I tried it here:
    http://live.datatables.net/jetojape/1/edit

    In order to get the rows in the reordered order I added draw() to the row-reordered event. You can probably do the same as a workaround but it does seem like an unexpected behavior.

    @allan or @colin can let us know if this is expected behavior. I would expect not to need the extra draw() to get the data in the new order within the row-reordered event.

    Kevin

  • ymolinetymolinet Posts: 2Questions: 1Answers: 0

    @kthorngren you are the best :smiley:
    it's perfectly working by adding this workaround.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @kthorngren and @ymolinet ,

    Yep, that looks wobbly to me - I'll raise a ticket for is. Apologies for the delay in replying, another one that got lost in the inbox...

    Cheers,

    Colin

This discussion has been closed.