"bServerSide": true - Problem when sorting.
"bServerSide": true - Problem when sorting.
mstojanov
Posts: 3Questions: 1Answers: 0
Hello.
I am really new to datatables and i got this problem right now :
My problem is when "bServerSide" is set to true i cant sort my columns and i cant use the search button i dont get any results and also i cant use the paginate button i cant go to page no.2.
But when i set "bServerSide" to false everything works fine.
I am using ignite datatables for codeigniter and also using the framework codeigniter.
Here is my code :
$('#data').dataTable({
'bProcessing': true,
"bSort" : true,
"iDisplayStart ": 10,
"bServerSide": false,
"aLengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
'sAjaxSource': '<?php echo site_url(); ?>admin/get_all_employees',
"oLanguage": {
"sProcessing": "<img src='<?php echo base_url(); ?>images/processing.gif'><br /> Processing...",
},
'fnServerData': function (sSource, aoData, fnCallback) {
$.ajax({
"dataType":'json',
"type":"POST",
"url":sSource,
"data":aoData,
"success":fnCallback
});
},
"aoColumns": [
{ "data": "username" },
{ "data": "email" },
{ "data": "first_name" },
{ "data": "last_name" },
{ "data": "contactphone" },
{ "data": "dateofjoin" },
{ "data": "birthdate" },
{ "data": "city" },
{ "data": "depNAME" },
]
});
Any help will be appreacited.
Thanks.
This discussion has been closed.