Datatables and ORM Model |
Hi
I'm building a new ORM Model, which uses sqlsrv driver and works PHP Code: <?php I load that model from a Library and return data to Controller Code: $data = json_encode($this->mymodel->findAll()); Now, I must use Datatables in the view, with serverSide=true and Ajax property pointing to Controller's url The json format for Datatables is custom and must have additional fields (draw, recordsTotal, data, etc.) https://datatables.net/manual/server-side Code: { PS: I've already seen https://github.com/hermawanramadhan/Code...DataTables but it won't fit my needs in future Does anyone have an example about how to build that custom json using the methods from ORM ? Thanks a lot for any tip you can give me
Enrique
https://beza.com.ar
I am using sEcho from datatables post, iTotalRecords using row count before applying filters and limit in query and iTotalDisplayRecords as row count after applying filters and limit. aaData is the actual query result.
Code: $iFilteredTotal = $result['filteredRecords']; (04-07-2022, 11:38 PM)JustJohnQ Wrote: // Output Yes, the parameters and structure changed in latest versions This is so far the code I could build to work with sqlsrv SQL Server, ysing its syntax, etc. This is a controller which handles post request from Datatables Code: $request = \Config\Services::request(); It is working so far
Enrique
https://beza.com.ar |
Welcome Guest, Not a member yet? Register Sign In |