JQuery Mobile update table via AJAX and column-toggle stops working

后端 未结 1 1680
孤街浪徒
孤街浪徒 2021-01-24 05:01

I\'m creating a small app using JQM 1.4.2 and I\'m having an issue where I am updating a table without a page refresh using ajax. This works well and my table (the whole table)

相关标签:
1条回答
  • 2021-01-24 05:31

    It looks like jQM is keeping the popup with the list of columns from the first load of the table, so after subsequent loads it is not recreating the list. There is probably a more 'official' way to do this, but a quick workaround is to just remove the dynamic popup from the DOM each time you refresh the table:

    $("#visualUnitListTable-popup-popup").remove();        
    $("#visualUnitTable").html(data).enhanceWithin();
    

    Given your table id of visualUnitListTable, jQM creates a popup with an id of visualUnitListTable-popup-popup, so you can call remove() on that element right before updating the the table HTML.

    Here is a DEMO

    0 讨论(0)
提交回复
热议问题