Download the PHP package intracto/datatables-backend without Composer
On this page you can find all versions of the php package intracto/datatables-backend. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download intracto/datatables-backend
More information about intracto/datatables-backend
Files in intracto/datatables-backend
Package datatables-backend
Short Description Library to handle AJAX calls for datatables.net
License MIT
Homepage https://github.com/Intracto/datatables-backend
Informations about the package datatables-backend
Intracto DataTables library
Handle AJAX requests for Datatables.net.
Install
Columns
Container class to hold Column
objects. This is used to get the field for sorting.
Column
Hold data about a column, can be used for the frontend to render <th>
and let DataTables known which fields
are sortable and searchable (via javascript).
DataProvider
Get the data to show in the datatable. Requires Parameters
, DataTablesRepository
, ColumnTransformer
.
Parameters
Container class to hold data from the datatables AJAX request.
DataTablesRepositoryInterface
Defines query functions needed to fetch the data.
DataTablesRepositoryTrait
An implementation of DataTablesRepositoryInterface
with general queries. Only available for Doctrine ODM for now.
ColumnTransformerInterface
Transform data fetched from the Repository
to format needed for the datatables. The order of the fields is important here.
Example
Columns
Transformer
Repository
Controller
Frontend
External JS
Include ajax-datatables.js
after loading the official datatables.js plug-in
Twig html
Make sure the table has the "ajaxdatatable" class Loop all the columns in the table head
Default sorting needed? Add the class default_sort
and asc
|desc
to the <th>
to the correct column
Twig JS
On the twig page where the ajax datatable must be loaded, place following script block
The filters
are optional, here you can pass searchable/filterable fields