datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

Condition for inline edit on rows

Open JanStarman opened this issue 3 years ago • 2 comments

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 avatar Jan 05 '22 14:01 JanStarman

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

JanStarman avatar Jan 05 '22 14:01 JanStarman

How about

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

?

It is somehow hidden in Row section in docs.

elring avatar Jan 05 '22 20:01 elring