honze-net / nmap-bootstrap-xsl

A Nmap XSL implementation with Bootstrap.
920 stars 176 forks source link

Modify pagination to show all elements of a table #12

Closed 3isenHeiM closed 3 years ago

3isenHeiM commented 3 years ago

Hi, Thanks for this, I'm using it as part of my https://github.com/3isenHeiM/MassVulScan project ! ;)

Just a question : is it possible to modify the pagniation to have like Show 10,25,100,All entries ? I'd find it nice to be able to disable the pagination and display everything on a single page.

By searching a bit, this is set by the jquery.dataTables.min.js here :

aLengthMenu: [10, 25, 50, 100],

Given the documentation here, we should be able to mention the All. However, since this file is CDN-hosted I don't know how/where I've to put the modification.

I hope it helps !

Thanks !

honze-net commented 3 years ago

Hi,

Thank you for the feedback! Great to see other projects using my work! I will have a look into this. Yes, "all" would be great. Maybe I can add it after I included the source file from the CDN. This looks promising.

Thank you for the suggestion!

honze-net commented 3 years ago

You can add

$('#table-services').dataTable( {
  "lengthMenu": [ [10, 25, 50, 100, -1], [10, 25, 50, 100, "All"] ]
} );

after

$(document).ready(function() {
  $('#table-services').DataTable();
});

You will have to do this for each data table. I hope this helps! I will mark this for integration, push it through QA and then merge it into production.

honze-net commented 3 years ago

This has been implemented in #13. Thank you for your excellent work!