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: 21,374Questions: 26Answers: 4,957

    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,240Questions: 1Answers: 2,599

    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.