[eluser]stefenw[/eluser]
Hi
i am newbie in codeigniter , i need your help.
i use latest ignited datatables with mssql database,
every function is work for me except paging,
first display it work fine with 10 show record,when i click page 2 its show 1-20 records,page 3 show 1-30 records.
please help
paging in datatables
Code:
private function get_paging() {
$iStart = $this->ci->input->post('iDisplayStart');
$iLength = $this->ci->input->post('iDisplayLength');
if ($iLength != '' && $iLength != '-1')
$this->ci->db->limit($iLength, ($iStart) ? $iStart : 0);
}
initialization
Code:
var oTable = $('#big_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '<?php echo base_url(); ?>index.php/subscriber/datatable',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayStart ":20,
"oLanguage": {
"sProcessing": "<img src='<?php echo base_url(); ?>assets/images/ajax-loader_dark.gif'>"
},
"fnInitComplete": function() {
//oTable.fnAdjustColumnSizing();
},
'fnServerData': function(sSource, aoData, fnCallback)
{
$.ajax
({
'dataType': 'json',
'type' : 'POST',
'url' : sSource,
'data' : aoData,
'success' : fnCallback
});
}
} );
controller
Code:
function datatable()
{
$this->datatables->select('nik,nama,nickname')
->from('dbo.tb_mt_PIM');
echo $this->datatables->generate();
}
please help ..