I work with datatable library, and i want to show all rows on tapping on the separate button.
I try to use few methods but its not working.
My code:
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
});
I try to use this parameter:
'iDisplayLength': 100
But this is not working for me, plus I need to have this possibility not like parameter but like separate function.