client side pagination with server side data response in jason
client side pagination with server side data response in jason
kamalpreet
Posts: 2Questions: 2Answers: 0
Hi I am fetching some records from server side keeping bserverside=true but I want it to be displayed 20 records per page on client side . Please tell me how to do it?
This discussion has been closed.
Answers
You can specify the "pageLength" parameter to tell datatable, the number of records you want to display per page.
For more info. check : https://datatables.net/reference/option/pageLength
If you are using datatable version 1.9 than refer this : http://legacy.datatables.net/ref#iDisplayLength
Hi I have this code working:
$('#tablename').dataTable({
"destroy" : true,
"bServerSide": true,
"sAjaxSource": "abc.do?method=search&&lastName=" + lastName + "&firstName=" + firstName,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"oLanguage": { "sEmptyTable": "No records to display"},
"iDisplayLength": 20,
"aoColumnDefs": [
Her I am fetching data from server side by ajax request but I want that search from default search box should be in client side filtering and pagination also in client side only..how can I achieve it? Do you know how to do that.
Hi I have this code working:
$('#tablename').dataTable({
"destroy" : true,
"bServerSide": true,
"sAjaxSource": "abc.do?method=search&&lastName=" + lastName + "&firstName=" + firstName,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"oLanguage": { "sEmptyTable": "No records to display"},
"iDisplayLength": 20,
"aoColumnDefs": [
Her I am fetching data from server side by ajax request but I want that search from default search box should be in client side filtering and pagination also in client side only..how can I achieve it? Do you know how to do that.