How to refresh JQuery mobile table after a row is added dynamically

后端 未结 2 1495
后悔当初
后悔当初 2021-01-19 10:41

I am adding rows to a JQ Mobile table based on a JSON string that I am getting from the server.

The first time I go to the page after a refresh, none of the styling

2条回答
  •  暖寄归人
    2021-01-19 11:19

    You should be able to just use: $("#myTable").table("refresh");

    But it hasn't been implemented for version 1.3.0 of jquery mobile.

    See https://github.com/jquery/jquery-mobile/issues/5570

    Sounds like you have to either add the rows before the page is initialized, or don't set the table's attribute data-role="table" until after the rows have been added. $("#myTable").table();

    In the implementation I am working on, I allow users to add rows. Luckily for me the site is designed to be viewed with larger mobile devices so I can wait for 1.3.1

提交回复
热议问题