ALL LengthMenu in DataTable is not working
ALL LengthMenu in DataTable is not working
![Asif Shaikih](https://secure.gravatar.com/avatar/a7b266dae9e5e39d5981dd389fcbc952/?default=https%3A%2F%2Fvanillicon.com%2Fa7b266dae9e5e39d5981dd389fcbc952_200.png&rating=g&size=120)
i have used "ALL" option of a DataTable LengthMenu but it returns all Record excluding the last record
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
please help for the same
thank you..
This discussion has been closed.
Answers
please help for the same
thank you
Happy to a test a look at a test case showing the issue.
Allan
this is my code
var table = $('#certificate_management').DataTable({
"bProcessing": true,
"dom": '<"top_tabel"Bpl>rt<"clear">',
buttons: [
{
extend: 'csv',
footer: false,
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 9, 10]
}
}
],
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"scrollY": "510px",
"scrollCollapse": false,
"responsive": true,
'serverSide': true,
"ordering": true,
"bInfo": false,
language: {
"sSearch": "",
"url": ADMIN_URL + "assets/js/swedish.json"
},
"fnDrawCallback": function () {
$('.dataTables_length select').addClass('lenthcls');
$('.lenthcls').select2({minimumResultsForSearch: -1});
$('input[type="search"]').css('display', 'none');
},
'order': [11, 'desc'],
'columnDefs': [{
"targets": 7, // your case first column
"className": "text-center c"
},
{
"targets": 8,
"className": "text-center"
},
{
"targets": [9, 10, 11],
"visible": false,
"searchable": false
}],
"aoColumns": [
null,
null,
{"bSearchable": false},
null,
null,
null,
null,
null,
null,
null,
null,
null
],
"ajax": $.fn.DataTable.pipeline({
url: ADMIN_URL + "Certificate/lists",
//pages: 1 // number of pages to cache
})
});
You have server-side processing enabled, so the issue will be in the server-side script. Is it setup to access a page length of -1 to return all entries?
Allan
The Code In DataTables.php
private function get_paging() {
$iStart = $this->ci->input->post('start');
$iLength = $this->ci->input->post('length');
i had see the Ajax respond which give me an All the Record
so i think may be the server side is ok.
you want to see the DataTables.php
may i send you ?
I'm afraid I can't debug your PHP - however, if all records expect form the last one is being returned, it would be worth outputting the SQL that your script is generating and making sure that there is no OFFSET or LIMIT in it.
Allan
hi....![](https://datatables.net/forums/uploads/editor/s8/7l5v6wdoh09a.png)
When i filter a Record and shown in Datatable the record is Shown in inproper format
please help for the same.
thanks in advance
.
i want like this![](https://datatables.net/forums/uploads/editor/ui/flc3j16k7xks.png)
Asif4394, you posted your last comment on two other threads, please ensure you only ask a question once! I'd say the filter question is separate from the OP here, so let's use the other thread for your filter problems.