Data dependant setActionButton

I need to show the button only if there is something in the “web” field.

The below does not work. How does one access data in the row array inside of a controller in this new version?

if ($row->web){
$crud->setActionButton(‘Web’, ‘fa fa-plus’, function ($value,$row) {return $row->web;},true);
}

1 Like

Hello @JDodd ,

Unfortunately this is not available in Grocery CRUD and I can’t think of any work-around for this. When you are adding a set action button it is for all the rows.

Regards
Johnny

Johnny, thanks for your reply. Too bad row data is not unavailable inside the controller.
I will still use Grocery CRUD for back end data maintenance, but just went ahead and wrote the front end in PHP.

Hello
Then go to the second alternative, create the button in a callbackcolumn.

It’s crazy but it’s a small solution

1 Like

Mariel thanks for your help, but I don’t know much about this program and find it is just easier to write applications with PHP, Ajax, etc.
One thing I found frustrating is all the information I found on the internet applies to the old version, and this new one is completly different.

i want to now about the more details of [Data dependant setActionButton] (Data dependant setActionButton) and software development

Thank you

Hi @JDodd,

maybe you can try this

https://discuss.grocerycrud.com/t/create-conditional-rules-per-row-on-the-grid/1091/2

regards,
dodo