Flash animation of the table row that has been edited
Flash animation of the table row that has been edited
I was just experimenting with some styles and found out that DataTables animate the table row that has been edited, as suggested in this post and it works in this example.
But when I want to use server-side processing serverSide: true
, the flash animation does not work anymore.
It does not work even in the example Server-side processing.
Could you please advise?
Peter
This discussion has been closed.
Replies
It doesn't work with server-side processing because the row that was updated gets removed and replaced when the table is redrawn. The server-side processing request will always cause new DOM nodes to be drawn.
The only way I can think of to make that flash work with server-side processing enabled would be to have an event listener on the
draw
event, know which row(s) were updated and then flash them.I've added a bug for this to my tracker, but I can't say for certain when it will be done I'm afraid.
Allan
I understand, thank you for the info.
Peter
FWIW, I have this code for dealing with "which row just got edited":
It's not animated - I just want the color change to sit there.
tangerine, thank you for the example! The only difference would probably be in
$(tr).addClass('last-update');
, right?Is there any DataTables function for the flash animation or is it ok to use jQuery
$(tr).toggle( "highlight" );
Highlight Effect?There isn't an exposed function for it, but this is the code that Editor uses to do its flash:
Allan
Allan, thank you for this additional information.
So, from the very useful comments everyone could make solution easily, but I will post one anyway:
One more time thank you both for the great help!