Closed ledniczkyrobert closed 3 years ago
Hey đź‘‹ @ledniczkyrobert Could you give a full example?
Yes, a working example in a view (except for the print button):
`<?= \nullref\datatable\DataTable::widget([
'data' => $dataprovider->getModels(),
'tableOptions' => [
'class' => 'display cell-border',
],
'paging' => false,
'dom' => 'Bfrtip',
'buttons' => [
['extend' => 'print'
]
],
'columns' => [
[
'data' => 'id',
'title' => 'ID'
],
[
'data' => 'th_site',
'title' => 'TH',
],
[
'data' => 'loc',
'title' => 'Location',
],
],
'language'=> [
'info' => 'Találatok: _START_ - _END_ Összesen: _TOTAL_',
'infoFiltered' => '(_MAX_ összes rekord közül szűrve)',
'infoEmpty' => 'Nincs találat',
'search' => 'Szűrés'
]
]) ?>`
What i can see in vendor/bower/datatables/media/js folder, that ther is no files like dataTables.buttons.js and buttons.print.js, these are requirements for the print button to work according to datatables.net.
Looks like custom stuff.
I guess you should create a new AssetBundle
that adds files that you need.
Feel free to create PR for this repo if you wish.
One more option is to override the default asset bundle. Please check the readme section about it: https://github.com/NullRefExcep/yii2-datatables#custom-assets
🤷‍♂️
Adding
'dom' => 'Bfrtip', 'buttons' => [ 'print' ],
not working