Adjust table results number

Adjust table results number

ridgeandgableridgeandgable Posts: 3Questions: 2Answers: 0

Hi Guys

new to using this Table but loving how it looks. Is there a way I can increase the drop down result number?

Instead of 10, 20, 25, I would like to add 100 and All?

Answers

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    Use the lengthMenu option.

    Kevin

  • ridgeandgableridgeandgable Posts: 3Questions: 2Answers: 0

    This is what IO have in the js file

    window.addEventListener('DOMContentLoaded', event => {
        // Simple-DataTables
        // https://github.com/fiduswriter/Simple-DataTables/wiki
    
        const datatablesSimple = document.getElementById('datatablesSimple');
        if (datatablesSimple) {
            new simpleDatatables.DataTable(datatablesSimple);
            $('datatablesSimple').dataTable( {
      "lengthMenu": [[ 10, 25, 5, -1],[10, 25, 50, "All"]]
    } );
        }
    });
    
    
  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    Yep, so you would need,

    "lengthMenu": [[ 10, 25, 50, 100, -1],[10, 25, 50, 100, "All"]]
    

    Please see here,

    Colin

Sign In or Register to comment.