//usertable的頁面刷新 $("#usertable").bootstrapTable('refresh'); //第一種:當模態框完全關閉時的初始化 $('#myModal').on('hide.bs.modal', function () { $('input').removeAttr("readonly"); }).modal('hide'); //第二種:當模態框完全關閉時的初始化 $('#addItemModel').on('hidden.bs.modal', function (e) { //第一種:form表單清空 $("#item_form")[0].reset(); //第二種:清除模態框中的內容 document.getElementById("contact_form").reset(); }).modal('hide');; //當模態框完全打開時的初始化 $("#userModel").on("shown.bs.modal", function () { $("#usertable").bootstrapTable('refresh'); }).modal('show');
參考地址:https://blog.csdn.net/qq_42806727/article/details/90067739