OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

export to excel using datatable

  • Thread starter Thread starter user1004
  • Start date Start date
U

user1004

Guest
I want to export to excel. here is my code.

Code:
$('#tabelku').dataTable({
                        
                        dom: 'Bfrtip',
                        "buttons": [{
                            extend: 'excel',
                            text: 'Excel'
                            
                            }
                        ],
                        dom: '<"row"<"col-lg-6"l><"col-lg-6"f>><"table-responsive"t>p',
                        "aLengthMenu": [
                            [10, 20, 30, 40, -1],
                            [10, 20, 30, 40, "All"] // change per page values here
                        ],
                        
                        "bProcessing": true,
                        "bServerSide": true,
                        "sServerMethod": "POST",
                        "bRetrieve": true,
                        "sAjaxSource": "<?= site_url() ?>monev/do_Tabel_Universitas",
                        // set the initial value
                        "iDisplayLength": 10,
                        "oLanguage": {
                            "sProcessing": '<i class="fa fa-coffee"></i>&nbsp;Please wait...',
                            "sLengthMenu": "_MENU_ records",
                            "oPaginate": {
                                "sPrevious": "Prev",
                                "sNext": "Next"
                            }
                        },
                        "aoColumnDefs": [{
                                'bSortable': false,
                                'aTargets': [0, 8]
                            }
                        ],
                        
                    });

the button Excel already shows but the problem is dropdown contains 10, 20, 30, 40 records is missing.. before I add this code

Code:
dom: 'Bfrtip',
                        "buttons": [{
                            extend: 'excel',
                            text: 'Excel'
                            
                            }
                        ],

the dropdown 10, 20, 30, 40 can show.. any code that I missing ??

<p>I want to export to excel. here is my code.</p>
<pre><code>$('#tabelku').dataTable({

dom: 'Bfrtip',
"buttons": [{
extend: 'excel',
text: 'Excel'

}
],
dom: '<"row"<"col-lg-6"l><"col-lg-6"f>><"table-responsive"t>p',
"aLengthMenu": [
[10, 20, 30, 40, -1],
[10, 20, 30, 40, "All"] // change per page values here
],

"bProcessing": true,
"bServerSide": true,
"sServerMethod": "POST",
"bRetrieve": true,
"sAjaxSource": "<?= site_url() ?>monev/do_Tabel_Universitas",
// set the initial value
"iDisplayLength": 10,
"oLanguage": {
"sProcessing": '<i class="fa fa-coffee"></i>&nbsp;Please wait...',
"sLengthMenu": "_MENU_ records",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [0, 8]
}
],

});
</code></pre>
<p>the button Excel already shows but the problem is dropdown contains 10, 20, 30, 40 records is missing..
before I add this code</p>
<pre><code>dom: 'Bfrtip',
"buttons": [{
extend: 'excel',
text: 'Excel'

}
],
</code></pre>
<p>the dropdown 10, 20, 30, 40 can show..
any code that I missing ??</p>
 

Latest posts

ن
Replies
0
Views
1
نعمان منذر محمود الجميلي
ن
Top