From 241fb8394d1d828de58ef1f9dac75ca530716f75 Mon Sep 17 00:00:00 2001 From: pxpm Date: Wed, 18 Sep 2024 11:22:41 +0100 Subject: [PATCH 1/2] update line buttons docs --- 6.x/crud-operation-list-entries.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/6.x/crud-operation-list-entries.md b/6.x/crud-operation-list-entries.md index 7b5b74a9..2ca9d039 100644 --- a/6.x/crud-operation-list-entries.md +++ b/6.x/crud-operation-list-entries.md @@ -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 `lineButtonsAsDropdownMinimumToDrop` and `lineButtonsAsDropdownDropAfter`. By default the dropdown is created no matter how many buttons are present in the line stack. You can change this behavior by setting `lineButtonsAsDropdownMinimumToDrop` 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 `lineButtonsAsDropdownDropAfter` to a number to drop the buttons after that number of buttons. + +```php +CRUD::setOperationSetting('lineButtonsAsDropdown', true); +CRUD::setOperationSetting('lineButtonsAsDropdownMinimumToDrop', 5); // if there are less than 5 buttons, don't create the dropdown (default: 1) +CRUD::setOperationSetting('lineButtonsAsDropdownDropAfter', 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 in the line stack, 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**. From 2637b3c86714661743a2a40cc89ec2b8989e9ddd Mon Sep 17 00:00:00 2001 From: pxpm Date: Wed, 18 Sep 2024 15:33:52 +0100 Subject: [PATCH 2/2] wip --- 6.x/crud-operation-list-entries.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/6.x/crud-operation-list-entries.md b/6.x/crud-operation-list-entries.md index 2ca9d039..ed0011fc 100644 --- a/6.x/crud-operation-list-entries.md +++ b/6.x/crud-operation-list-entries.md @@ -97,15 +97,15 @@ b) For a specific CrudController, in its `setupListOperation()` define `CRUD::se ##### Available options -Additionally you can control the dropdown behavior with `lineButtonsAsDropdownMinimumToDrop` and `lineButtonsAsDropdownDropAfter`. By default the dropdown is created no matter how many buttons are present in the line stack. You can change this behavior by setting `lineButtonsAsDropdownMinimumToDrop` 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 `lineButtonsAsDropdownDropAfter` to a number to drop the buttons after that number of buttons. +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('lineButtonsAsDropdownMinimumToDrop', 5); // if there are less than 5 buttons, don't create the dropdown (default: 1) -CRUD::setOperationSetting('lineButtonsAsDropdownDropAfter', 3); // force the first 3 buttons to be inline, and the rest in a dropdown (default: 0) +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 in the line stack, they will be shown inline +// - 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 ```