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

[Bug] Adding a button to 'end' of 'line' doesn't position it after edit button #3418

Closed
realtebo opened this issue Dec 23, 2020 · 2 comments
Closed
Labels

Comments

@realtebo
Copy link
Contributor

Bug report

What I did

In my setup()

 $this->crud->addButtonFromView('line', 'conditional_delete', 'conditional_delete', 'end');

In setupListOperation()

$this->crud->removeButton("delete");

What I expected to happen

I expect to see preview, edit and THEN my 'delete' button

What happened

Like you can see, my customized delete button is placed BEFORE 'update' and not at the 'end' of 'line'

image

What I've already tried to fix it

I don't know what to do

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:


mirko@dev:/mnt/hgfs/progetti/mediaset/procedimenti$ php artisan backpack:version
### PHP VERSION:
PHP 7.3.24-3+0~20201103.72+debian10~1.gbp945915 (cli) (built: Nov  3 2020 14:31:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.24-3+0~20201103.72+debian10~1.gbp945915, Copyright (c) 1999-2018, by Zend Technologies

### LARAVEL VERSION:
v8.20.1@b5d8573ab16027867eaa1ac148893833434f9b02

### BACKPACK VERSION:
4.1.30@62856b1f01fc3e05c80140fc22f85ea2aac8368c

@realtebo realtebo changed the title [Bug] Additing a button to 'end' of 'line' doesn't position it after edit button [Bug] Adding a button to 'end' of 'line' doesn't position it after edit button Dec 23, 2020
@iMokhles
Copy link
Contributor

actually you should add your ( list ) related buttons inside thesetupListOperation() function :( i'm aware that the doc says you should add it inside setup but i guess the doc specially in this part not updated @tabacitu

@tabacitu
Copy link
Member

Exactly, the docs were out of date, thanks @iMokhles . Updated.

@realtebo try doing that inside your setupListOperation() instead. Additionally, consider the fact that the operation setup methods are done in the order in which the traits are used. So reordering the operation traits at the top of your CrudController will also reorder the buttons.

Hope it helps. Cheers!

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

No branches or pull requests

3 participants