Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JPustkuchen committed May 15, 2021
1 parent ff61169 commit 88b707a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,13 @@ window.$.DataTable = dt;
window.dt = dt;
~~~

Then you'll have to wrap the table.html.twig in a parent twig file containing the datatables.net initialisation, for example like this (or any other way):
Then you'll could for example wrap the bundles *table.html.twig* in a parent twig file containing the DataTables.net initialisation, for example like this (or any other way):
```php
{# prettier-ignore-start #}
<script>
$( document ).ready(function() {
$('#' + '{{id|default('datatable')|escape('html_attr')}}').DataTable({/* Optional datatables.net Options */});
});
</script>
{# prettier-ignore-end #}
<div id="{{ id|default('datatable')|escape('html_attr') }}-wrapper" class="datatable-wrapper">
{% include 'table.html.twig' %}
</div>
Expand Down

0 comments on commit 88b707a

Please sign in to comment.