Datatables draw length menu

Datatables draw length menu

johngtrsjohngtrs Posts: 33Questions: 2Answers: 0

I want to draw the length menu out the table as I did it for the global search :

HTML

<input type="text" id="myInputTextField">

Javascript

$('#myInputTextField').keyup(function(){
   myTable.search($(this).val()).draw() ;
})

It is possible to do that with the length menu ?

Replies

  • LaucianLaucian Posts: 1Questions: 0Answers: 0
    edited January 2016

    Try something like:

    $('#myInputTextField').keyup(function (e) {
       var value = $( this ).val();
       if (e.keyCode === 13) { //This launch with Enter key
          myTable.page.len( value ).draw();
       }
    });
    
This discussion has been closed.