cahyadsn / ci-datatables

Library for server side datatables implementation on codeigniter
MIT License
15 stars 17 forks source link

No Example file #1

Open zionnite opened 2 years ago

zionnite commented 2 years ago

Please can u provide an example for this library

mckaygerhard commented 1 year ago

hi @cahyadsn this is a great library.. but i have only a doub.. seems need to trap the request and parsed to the internal lib, into filter propiety, right?

i get into data using:

        $data = json_decode($this->datatables->generate('json'));
        foreach ($data->aaData as $val) {    $buttons = '';   $dat[] = $val;  }
        $output = array();
        $output['draw'] = $data->sEcho;
        $output['recordsTotal'] = $data->iTotalRecords;
        $output['recordsFiltered'] = $data->iTotalDisplayRecords;
        $output['data'] = $dat;
        $output['columns'] = $data->sColumns;
        echo json_encode($output, JSON_PRETTY_PRINT);

Returning data is perfect, that what expected datatables, but, the rest of the things for server side are lost in the javascript,

seems do not work with jquery 1 right? neither server side.. cos we need to retrieve all the values with new variable names?

https://github.com/cahyadsn/ci-datatables#this-datatables-generateoutput-charset this part mention the datatables result object as array .. is wrong also