Fohn-Group / fohn-ui

PHP framework using Tailwind Css
MIT License
2 stars 2 forks source link

Allow disabling table row action button #32

Closed ibelar closed 4 months ago

ibelar commented 4 months ago

A row action button can be disable via Action::disableActionName method.

\\ Set table and column.

$editActionFn = $table->addActionColumn('action', 'edit', AppTest::tableBtnFactory('bi bi-pencil-fill'));
$editActionFn->executes($editDialog->jsOpenWithId(Js::var('cell.id')));

$table->getTableColumn('action')->disableActionName('edit', static function ($rowValue) {
     // return true or false
    return true 
});