Disable Pagination when Search

Disable Pagination when Search

pettedemonpettedemon Posts: 38Questions: 6Answers: 0

Hi,
I have the server side database.
at default the lengthMenu is 50.
So when I search I want disable the pagination.
is it possible?
thanks

This question has an accepted answers - jump to answer

Answers

  • pettedemonpettedemon Posts: 38Questions: 6Answers: 0

    So, when I search a string I will see all the results, without the default pagination

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @pettedemon ,

    You can't disabled paging altogether, but you can do something like this here and make it very large.

    Hope that helps,

    Cheers,

    Colin

  • pettedemonpettedemon Posts: 38Questions: 6Answers: 0
    edited October 2019

    Hi, thanks!
    But how can enable the server side processing in your script?

    ` $('#sorting').DataTable( {
    "processing": true,
    "serverSide": true,

        "order": [[0, 'desc']],
        "ajax": "scripts/server_processing.php",
            "lengthMenu": [[50,100, 250, 500, -1], [50,100, 250, 500, "Tutti"]],
        "language": {
            "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Italian.json"
        },
        "columns":[
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": true
            },
            {
                "sortable": false
            },
            {
                "sortable": false
            },
            {
                "sortable": false
            },
            {
                "sortable": false
            },
             {
                "sortable": false
            }
        ],
    
    
    } );
    

    `

  • kthorngrenkthorngren Posts: 21,328Questions: 26Answers: 4,949
    Answer ✓

    You can use one of the server side JS BIN examples here:
    https://datatables.net/manual/tech-notes/9#Server-side-processing

    Kevin

This discussion has been closed.