How do I make a single row noneditable/read only? #856
Answered
by
dansysanalyst
islandnuge
asked this question in
Q&A
-
I'm looking to make some rows of my datagrid table entirely read-only or disabled (depending on the users's state). I'm considering using CSS for this, but am looking to ensure that buttons and editable states are not visible underneath - is this possible? |
Beta Was this translation helpful? Give feedback.
Answered by
dansysanalyst
Feb 18, 2023
Replies: 1 comment
-
Hi @islandnuge, Currently, you can use Action Rules to control the rows. It might look something like this: final class MyTable extends PowerGridComponent
{
//...
public function actionRules(): array
{
return [
Rule::rows()
->when(fn ($user) => $user->isActive() === false)
->disable(),
->hide(),
->hideToggleable(),
->setAttribute('class', 'bg-gray-50'),
} There is no rule to disable editOnClick, but, we welcome a pull request for this feature. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
luanfreitasdev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @islandnuge,
Currently, you can use Action Rules to control the rows.
It might look something like this:
There is no rule to disable editOnClick, but, we welcome a pull request for this feature.