目前我有一個這樣的數(shù)據(jù)表,https://prnt.sc/nbfmge當(dāng)用戶單擊任何項目時,我正在打開bootstrap 4 modal,它將打開https://prnt.sc/nbfmrj但是當(dāng)數(shù)據(jù)表處于模式時,我沒有獲得搜索和分頁功能。這是我的代碼這是HTML代碼:<!-- Modal body --><div class="modal-body"> <div class="card"> <div class="card-header"> <h5 class="card-title float-left">List of items</h5> </div> <div class="card-body row"> <div class="col-md-12"> <div class="table-responsive"> <table class="table table-bordered display" id="datatables"> <thead> <tr> <th scope="col">#</th> <th scope="col">Item Name</th> <th scope="col">Item Model</th> <th scope="col">Item Year</th> <th scope="col">Item Condition</th> <th scope="col">Item Price</th> <th scope="col">Status</th> </tr> </thead> <tbody id="showEmployeesReportItems"> <!-- List of Items --> </tbody> </table> </div> </div> </div> </div></div>這是我的jQuery代碼:$('#datatables').DataTable().destroy();$('#showEmployeesReportItems').html(html);$('#datatables').DataTable();如何獲得模態(tài)數(shù)據(jù)表中的分頁和搜索功能?
jQuery Datatable問題與Bootstrap 4模態(tài)
慕碼人8056858
2021-04-13 17:18:52