yajra / laravel-datatables-buttons

Laravel DataTables Buttons Plugin
https://yajrabox.com/docs/laravel-datatables/buttons-installation
MIT License
254 stars 53 forks source link

Layout feature is not documented #190

Open mortenscheel opened 1 week ago

mortenscheel commented 1 week ago

Summary of problem or feature request

The old ->dom() method is deprecated, and replaced by ->layout(), but it's unclear how it should be used. The various builder methods on Layout accept an $options argument, but what it's supposed to contain isn't clear.

System details

yajra commented 1 week ago

You can use the Layout Builder class:


use Yajra\DataTables\Html\Layout;

...
->layout(fn (Layout $layout) => $layout->topStart('pageLength')->bottom(['info', null, 'paging']))
mortenscheel commented 6 days ago

Thanks. Doesn't work for me. The Layout feature was introduced in DataTable 2.0, and your installation guide lists v1.10.x as a requirement.

yajra commented 6 days ago

Yes, you need to use DataTable v2 if you want to use layout. And don't mix up dom with layout because it causes issues when used simultaneously like I remember when I upgraded from v1 to v2.