Skip to content

Commit

Permalink
Merge pull request #598 from Laravel-Backpack/update-line-buttons-docs
Browse files Browse the repository at this point in the history
update line buttons docs
  • Loading branch information
pxpm authored Sep 18, 2024
2 parents 33b63fc + 2637b3c commit 79d31f9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 6.x/crud-operation-list-entries.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ a) For all CrudController (globally) in the `config/backpack/operations/list.php

b) For a specific CrudController, in its `setupListOperation()` define `CRUD::setOperationSetting('lineButtonsAsDropdown', true);`

##### Available options

Additionally you can control the dropdown behavior with `lineButtonsAsDropdownMinimum` and `lineButtonsAsDropdownShowBefore`. By default the dropdown is created no matter how many buttons are present in the line stack. You can change this behavior by setting `lineButtonsAsDropdownMinimum` to a number. If the number of buttons in the line stack is less than this number, the buttons will not be converted to a dropdown. You can also set `lineButtonsAsDropdownShowBefore` to a number to drop the buttons after that number of buttons.

```php
CRUD::setOperationSetting('lineButtonsAsDropdown', true);
CRUD::setOperationSetting('lineButtonsAsDropdownMinimum', 5); // if there are less than 5 buttons, don't create the dropdown (default: 1)
CRUD::setOperationSetting('lineButtonsAsDropdownShowBefore', 3); // force the first 3 buttons to be inline, and the rest in a dropdown (default: 0)

// in the above example, when:
// - there are 3 or less buttons, they will be shown inline
// - there are 4 buttons, all 4 will be shown inline
// - there are 5 or more buttons, the first 3 will be shown inline, and the rest in a dropdown
```

To learn more about buttons, **check out the [Buttons](/docs/{{version}}/crud-buttons) documentation page**.

<a name="filters"></a>
Expand Down

0 comments on commit 79d31f9

Please sign in to comment.