Download the PHP package uvoelkel/serverside-datatables-bundle without Composer
On this page you can find all versions of the php package uvoelkel/serverside-datatables-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download uvoelkel/serverside-datatables-bundle
More information about uvoelkel/serverside-datatables-bundle
Files in uvoelkel/serverside-datatables-bundle
Package serverside-datatables-bundle
Short Description DataTables integration for Symfony
License MIT
Homepage https://github.com/uvoelkel
Informations about the package serverside-datatables-bundle
DataTablesBundle
What it does
The DataTablesBundle let's you easily create (sortable and filterable) serverSide DataTables from Doctrine entities.
License
This bundle is under the MIT license. See the complete license in the bundle:
LICENSE
Installation
Enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
Configuration
After installing the bundle, make sure you add this route to your routing:
# app/config/routing.yml
datatables:
resource: "@VoelkelDataTablesBundle/Resources/config/routing.xml"
Localization
# app/config/config.yml
voelkel_data_tables:
localization:
locale: "%locale%"
data:
true: "Jepp"
false: "Nope"
datetime: "Y-m-d H:i:s"
Usage
Create a Table definition
In your CustomerController
And in your index template
# AppBundle/Resources/views/Customer/index.html.twig
{% extends '::base.html.twig' %}
{% block body %}
{{ datatables_html(table) }}
{% endblock %}
{% block javascripts %}
<script>
{{ datatables_js(table) }}
// access the table instance
{{ table.name }}_table.on('dblclick', 'tbody tr', function () {
alert('dblclick');
});
</script>
{% endblock %}
Access DI container
Table definition as a service
Define the service
# AppBundle/Resources/config/services.xml
<service id="app.table.customer" class="AppBundle\DataTable\CustomerTable">
<argument type="service" id="my.awesome.service" />
</service>
Set the service id in the table constructor
In your controller
Column filter
Table options
- 'stateDuration': -1 sessionStorage. 0 or greater localStorage. 0 infinite. > 0 duration in seconds
Column options
- 'filter' != false implies 'searchable' = true
- 'multiple' has no effect if filter != 'select'
- 'expanded' has no effect if filter != 'select'