datagrid
datagrid copied to clipboard
Condition for inline edit on rows
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
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
How about
$grid->allowRowsInlineEdit(function($item) {
return $item->myColum > 50;
});
?
It is somehow hidden in Row section in docs.