Search code examples
javascriptjqueryhtmltwitter-bootstrapbootstrap-table

Bootstrap Table delete dynamic element after sorting the table


I have an issue with wenzhixin Bootstrap Table, in one of the table cell there is a button, and once this button is pressed it is deleted and a new button with popover is created dynamically.

The problem is once the table is sorted - the new button is deleted and the old button comes alive.

All the description that i have described is available in the following fiddle:

http://jsfiddle.net/eitanmg/gmtm3d9k/1/

How can I keep the new button after the table is sorted?


Solution

  • This seems to be a known issue of the plugin. The issue is reported here and it is still open. The sort basically re-renders the table back to its original state, discarding all dynamically made modifications to it.

    I suggest using tablesorter for sorting purposes.