Changing editoption based on an other column value?

QuestionsChanging editoption based on an other column value?
Tim Moore asked 3 years ago

I am not sure why I can not figure this out, but I have waisted a lot of time on this.

I want to change options based on the value of a column for that row.

pseudo code

if {job_open} = ‘c’ then $str=”1:A;2:B” else $str=”1:A;2:B;3:C”

$col = array();
$col[“title”] = “Job_open”;
$col[“name”] = “job_open”;
$col[“width”] = “75”;
$col[“editable”] = false;
$col[“export”] = false;
$col[“hidden”] = true;
$cols[] = $col;

$col = array();
$col[“title”] = “Job Status”;
$col[“name”] = “job_status”;
$col[“width”] = “75”;
$col[“editable”] = true;
$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>$str);
$col[“show”] = array(“list”=>true, “add”=>false, “edit”=>true, “view”=>true, “bulkedit”=>false);
$col[“export”] = true;
$cols[] = $col;

 

if someone can help me with this, it would be appreciated. Thanks in advance.

1 Answers
Abu Ghufran Staff answered 3 years ago

Hello,

You can refer this demo code:

https://gist.github.com/gridphp/fba1dd02dd537ba5c3441835d86d0538

Line 70-89

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

7 + 1 =

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?