laravel-datatables-buttons
laravel-datatables-buttons copied to clipboard
Layout feature is not documented
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
- MacOS 15.0
- PHP 8.3.12
- Laravel 11.23.5
- Laravel-DataTables 11.2.1
You can use the Layout Builder class:
use Yajra\DataTables\Html\Layout;
...
->layout(fn (Layout $layout) => $layout->topStart('pageLength')->bottom(['info', null, 'paging']))
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.
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.