我使用數據表庫,我想在點擊單獨的按鈕時顯示所有行。我嘗試使用幾種方法但它不起作用。我的代碼:if (val != '') { $('#' + tableId + '').DataTable({ destroy: true, lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], // this is not working, showing default values searchPanes: { layout: 'columns-' + length + '' }, columnDefs: [{ searchPanes: { show: true }, targets: '_all' }], dom: 'Pfrtip' }); $('.dtsp-searchPanes').children().each(function (i, obj) { if (!val.includes(i)) $(this).hide(); else $(this).show(); });} else { $('#' + tableId + '').DataTable({ destroy: true });}$("#showAll").on("click", function () { //here i need func});我嘗試使用這個參數:'iDisplayLength': 100但這對我不起作用,而且我需要這種可能性,不像參數,而是像單獨的函數。
如何使用 Datatable jQuery 顯示表上的所有行
FFIVE
2023-09-21 10:53:29