Welcome Guest, Not a member yet? Register   Sign In
Ignited datatables always return only 100 rows..
#1

[eluser]Tonko[/eluser]
Hi all, I need your help. I have table where is 404 rows and I use ignited datatables library to show them.
I have problem, because the ignited datatables library always return MAX 100rows
But my controller show this: {"sEcho":0,"iTotalRecords":402,"iTotalDisplayRecords":402,"aaData" [and here is only 100 records, not all 404]...

this is my jquery code in view:
Code:
var oTable = $('.mws-datatable-fn').dataTable( {
     "bProcessing": true,
     "aLengthMenu": [[10, 25, 50, 100, 500, 1000, 5000, -1], [10, 25, 50, 100, 500, 1000, 5000, "All"]],
"iDisplayLength": 1000,
     "sAjaxSource": "<?php echo base_url(); ?>companies/datatables",
     "sPaginationType": "full_numbers"
    } );

and my controller:
Code:
$this->load->library('companies/datatables');

        $this->datatables->select('id, name, kind, address_city, address_country, sales_agent');
        $this->datatables->from('companies');
        echo $this->datatables->generate();
... is this bug or how to solve it? Thanks for help
#2

[eluser]johnpeace[/eluser]
Do you have the profiler turned on and displaying the queries that are being run?

Code:
$this->output->enable_profiler(TRUE);

Use Firebug to check the POST request and make sure that iDisplayLength is being sent with the request (looks like the datatables library isn't finding it).
#3

[eluser]Tonko[/eluser]
I have figured it out by editing the function get_paging in datatables library:form
Code:
$this->ci->db->limit(($iLength != '' && $iLength != '-1')? $iLength : 100, ($iStart)? $iStart : 0);
to
Code:
$this->ci->db->limit(($iLength != '' && $iLength != '-1')? $iLength : 10000, ($iStart)? $iStart : 0);
I change the number of limit when lengt is not post... But I have no idea why it is not working properly... any idea why it is not posting the ilenght?




Theme © iAndrew 2016 - Forum software by © MyBB