Download the PHP package nlybe/datatables_api without Composer
On this page you can find all versions of the php package nlybe/datatables_api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nlybe/datatables_api
More information about nlybe/datatables_api
Files in nlybe/datatables_api
Package datatables_api
Short Description DataTables integration on Elgg
License GPL-2.0
Homepage https://github.com/nlybe/Elgg-DataTablesAPI
Informations about the package datatables_api
DataTables API for Elgg
DataTables integration on Elgg. This plugin offers an API which can be used from other plugins on Elgg platforms in order to populate information in data tables.
DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement and offers advanced interaction controls to any HTML table.
The plugin for Elgg offers the following options:
- Create a simple DataTable by loading all records (not suggested for large data set).
- Get records from database by using ajax requests.
- Use server-side options that DataTables provides, so all paging, searching and ordering actions are being made by using ajax requests to get the required data.
- Add export buttons such as copy, csv, pdf and print, if enabled in settings.
As a usage example you can see the Elgg Entity Lists which uses the datatables_api plugin for generating lists of Elgg entities.
Installation
Use composer to install this plugin. On site root folder, run the command:
How to Use
Example 1 - Use ajax request and Server-side processing
On 'views/default/resources/demoplugin/users.php' use the following code:
Example 2
The sample code below will display a DataTable with 3 columns. It's suggested for small about of records only.
Future Tasks List
- [ ] Make a class for datatables, so all parameters will be passed by using methods of this class
- [ ] Integrate more options from DataTables like styling, search by column etc
- [ ] Fix ordering when use server-side options