laravel-datatables-buttons icon indicating copy to clipboard operation
laravel-datatables-buttons copied to clipboard

Layout feature is not documented

Open mortenscheel opened this issue 1 year ago • 3 comments

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

mortenscheel avatar Oct 14 '24 14:10 mortenscheel

You can use the Layout Builder class:

use Yajra\DataTables\Html\Layout;

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

yajra avatar Oct 15 '24 02:10 yajra

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.

mortenscheel avatar Oct 15 '24 10:10 mortenscheel

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.

yajra avatar Oct 16 '24 01:10 yajra