1

Hi I have a following program. It works fine when iDisplayLength is 100. When we would like to change iDisplayLength as 200, the "Show ## entriesSearch" is empty. Is it be possible to customize "Show ## entriesSearch" in a way that entries over 200 shows 'All'. Any idea to do so?

function newVasDataTable() {
    var $newVasTable = $('#vas_table').dataTable({
        "aoColumnDefs" : [ {"sSortDataType" : "dom-checkbox","aTargets" : [ 0 ]} ],
        "iDisplayLength" : 100
    });
    return $newVasTable;
}
1
  • How do I know ? But, I see the existing code use jQuery function. Commented Jan 13, 2023 at 4:08

2 Answers 2

1

Seems you are working with an old version of datatables, so this may help you :

function newVasDataTable() {
    var $newVasTable = $('#vas_table').dataTable({
        "aoColumnDefs" : [ {"sSortDataType" : "dom-checkbox","aTargets" : [ 0 ]} ],
        "iDisplayLength" : 100,
        "aLengthMenu": [[10, 25, 50, 100, 200, -1], [10, 25, 50,100, 200, "All"]]
    });
    return $newVasTable;
}

More info can be found here

Sign up to request clarification or add additional context in comments.

1 Comment

This is a good solution in my case.
0

I partially found the customization here. Limit of displaying rows in DataTables but it does not say how to show 'All' when over 200.

function newVasDataTable() {
    var $newVasTable = $('#vas_table').dataTable({
        "aoColumnDefs" : [ {"sSortDataType" : "dom-checkbox","aTargets" : [ 0 ]} ],
        "iDisplayLength" : 200 ,
        "lengthMenu": [50, 100, 200],
        "pageLength": 200
    });
    return $newVasTable;
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.