Show entries dropdown disappear when using export tools

前端 未结 3 1492
一整个雨季
一整个雨季 2020-12-15 03:14

Show entries dropdown disappear when using export tools

$(document).ready(function() {
    $(\'#example\').DataTable( {
        dom: \'Bfrtip\', // if you re         


        
相关标签:
3条回答
  • 2020-12-15 03:26

    I know it is too long, but if some one still facing this issue, then please do the following, it is an alternate answer.

    Add 'pageLength' inside buttons as follows:

    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'pageLength','copy', 'csv', 'excel', 'print'
        ]
    } );
    
    0 讨论(0)
  • 2020-12-15 03:37

    This works for me:

    $(document).ready(function(){   
          dataTable = $('#myDataTable').DataTable({
             "processing":true,
             "serverSide":true,
              dom:'lBfrtip',
              buttons: ['excel', 'csv', 'pdf', 'copy'],
             "lengthMenu": [50,100,500,1000,2000,5000,10000,50000,100000],
             "order":[],
             "sScrollX": "100%",
             "scrollCollapse": true,
             "ajax":{
                url:"FetchAllAjax.php",
                type:"POST"
             }
          });       
       });
    
    0 讨论(0)
  • 2020-12-15 03:42

    You just lack the l flag in dom. l for "length changing input control".

    dom: 'lBfrtip'
    

    will make the dropdown to reappear.

    updated fiddle -> http://jsfiddle.net/p33x5L3t/1/
    dom documentation -> https://datatables.net/reference/option/dom

    0 讨论(0)
提交回复
热议问题