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

Condition for inline edit on rows #1010

Open
JanStarman opened this issue Jan 5, 2022 · 2 comments
Open

Condition for inline edit on rows #1010

JanStarman opened this issue Jan 5, 2022 · 2 comments

Comments

@JanStarman
Copy link

JanStarman commented Jan 5, 2022

Hi, is it possible to set condition for rows to allow or disable inline edit for them?
I couldn't find anything in documentation.
I was trying to do something similiar as what I do with actions: setRenderCondition, but couldn't make that work

i.e: only rows with value > 50 in column XYZ will have the option for inline edit

@JanStarman
Copy link
Author

JanStarman commented Jan 5, 2022

Ok for anyone wondering, I "solved" this after few hours by setting properties as disabled while setting defaults value for the row.

inside of
$this->getInlineEdit()->onSetDefaults[] = static function(Container $container, array $item)
do this:
$container->getComponent('columnName')->setDisabled();

But it would still be very nice to have the setRendererCondition feature to make it way more simple

@elring
Copy link
Contributor

elring commented Jan 5, 2022

How about

$grid->allowRowsInlineEdit(function($item) {
        return $item->myColum > 50;
      });

?

It is somehow hidden in Row section in docs.

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

No branches or pull requests

2 participants