I am new to JQuery Data tables. I have a requirement where in i have to display only last ten entered records in a data table with no pagination or sorting.I am able to get the last ten records with the ajax call. but in the header and footer i have the record information. Right now if i have total 25 records and i am displaying only last 10, the table header/footer will show : Records 1 to 10 of 10. This is because i have a language tag which is below:
"language":{
"info": "Records _START_ to _END_ of _MAX_",
},
But my requirement is to display: Records 5 to 15 of 15 or 7 to 17 of 17.
i checked data tables website, they had these for info keywords :
but with _MAX_
i am not getting the total records also with _START_
and _END_
i am getting Records 1 to 10 of 10 always even if my record sequence number which is getting displayed in the table is 5 to 15
Any help is appreciated. Please ask questions if my description is not enough.
Here is my Data Table initialization code:
var Table = $('#MyDataTable').DataTable({
"dom":'<i><"clear"><p><"bottomfmarg"f>t<i><"clear"><p>',
responsive: false,
"processing": true,
"ajax":{
"url":"URL",<%-- data will served via ajax request --%>
"type":"POST"
},
"deferRender": true,
"columns": [
{ "data": "col1"},
{ "data": "col2"},
{ "data": "col3"}
,{ "data": null,"defaultContent": "","orderable": false}
],
"paging": false,
"info": true,
"ordering":true,
"searching":false,
"serverSide":false,
"pagingType": "simple_numbers",
"lengthChange": false,
"pageLength":50, <%-- controls the pagination length --%>
"autowidth":true,
"language":{
"emptyTable": "No Records",
"info": "Records _START_ to _END_ of _MAX_",
"infoEmpty": "0 records",
"infoFiltered": "filtered from _MAX_ total Record(s)",
"loadingRecords": "Loading Records",
"infoPostFix": "",
"thousands": ",",
"search": "Filter search results:",
"zeroRecords": "0 Records"
}
});