rowactions depeding on value in master grid

Questionsrowactions depeding on value in master grid
Oliver asked 5 years ago

Hi Abu,

I am trying to show or hide the rowaction icons in the slave table.

But they should only be shown, if in the master table the value of a given cell is true. Therefore I subgridparams="invoice" this cell to the slave. In the slave I am doing this: $value = intval($_GET["invoice"]). Later I have this code:
$grid->set_actions(array( …..
"rowactions" => $value,
……

Unfortuantely this does not work. It seems as if this value can NOT be changed but has to be "hardcoded".

Or am I making a mistake?

Thx
Oliver

1 Answers
Abu Ghufran answered 5 years ago

Yes, thats true. This value should be hardcoded.
What you can do is to disable edit/delete operation when certain cell value is true.

For this, you need to set master column value as slave grid sql.
e.g.
$company = $_GET["invoice"];
$grid->select_command = "SELECT id,client_id,invdate,amount,tax,note,total,'$invoice' as 'invoice' FROM invheader WHERE client_id = $id";

Second, create a invoice column in slave grid, that will have master grid value (static).

Apply column access JS code to disable edit/del operations when invoice value of selected row is true.
Refer demos/editing/column-access.php for js demo.

Your Answer

8 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?