Get KoolPHP UI with 30% OFF!

How to make only certain rows in grid editable

Riho Ellermaa
I would like to hide the Modify and Delete buttons from certain rows, based on their data value. Is it possible with some event handler or am I forced to verifying the changes in BeforeUpdate event and ten telling to customer that he can't make the change?
Posted Aug 22, 2016 Kool
Peter
Hi, you may use the GridCalculatedColumn to replace the GridEditDeleteColumn. The GridCalculatedColumn allows you to customize the html display (edit button for example) base on a condition. So base on row data, you can let the Edit button show or hide. To trigger the row edit, you call this built-in grid_edit(this) function on the button click event
<button onclick="grid_edit(this)">Edit</button>

Here are some link to document:
http://doc.koolphp.net/Controls/KoolGrid/Javascript/Builtin_Functions/index.php#grid_edit
http://doc.koolphp.net/Controls/KoolGrid/PHP/GridCalculatedColumn/index.php
Please let us know if you need further assistance.
Posted Aug 23, 2016 , edited Aug 23, 2016 Kool -
Petr
Hello Peter, I 'm just solving exactly the same case but I don't understand how to use calculated column for show or hide edit/delete buttons. I understand how to use this column and its expression field for make some calculcation but how to pass condition to it?
To be more exact, I have one date field named active_from. And if the active_fromfor a particular row is in future, I want to show icons delete and edit. And if the active_from is in past, I want to hide it. Could you provide a full example please?
Thank you
Petr
Posted May 28 Kool