Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout feature is not documented #190

Open
mortenscheel opened this issue Oct 14, 2024 · 3 comments
Open

Layout feature is not documented #190

mortenscheel opened this issue Oct 14, 2024 · 3 comments

Comments

@mortenscheel
Copy link

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
@yajra
Copy link
Owner

yajra commented Oct 15, 2024

You can use the Layout Builder class:

use Yajra\DataTables\Html\Layout;

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

@mortenscheel
Copy link
Author

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
Copy link
Owner

yajra commented Oct 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants