Conditional cell

QuestionsConditional cell
Mike Olson asked 1 month ago

How come when I use the following column it only displays No2 and never displays Yes2?

 

The column contans rows that have Yes and No as values. But when I filter for Yes it displays No2 in the cell.

 

//Driveable
$col = array();
$col[“title”] = “Driveable”; // caption of column, can use HTML tags too
$col[“name”] = “driveable”; // grid column name, same as db field or alias from sql
$col[“dbname”] = “st.driveable”;
$col[“condition”] = array(‘$row[“st.driveable”] <> “No”‘, “No2″,”Yes2”);
$col[“search”] = true;
$col[“export”] = true;
$col[“stype”] = “select”;
$col[“searchoptions”] = array(“defaultValue”=>”,”value” => “:All;Yes:Yes;No:No”, “separator” => “:”, “delimiter” => “;”);
$cols[] = $col;

4 Answers
Mike Olson answered 1 month ago

Here is a screenshot of what I mean:

 

Mike Olson answered 1 month ago

image

Mike Olson answered 1 month ago

Are you still supporting this software?

 

 

Your condition statement breaks things. Please assist. I am now trying to use a condition on a field with a checkbox for add and edit and it breaks the checkbox.

 

 

//NOCALL
$col = array();
$col[“title”] = “No Call”; // caption of column, can use HTML tags too
$col[“name”] = “nocall”; // grid column name, same as db field or alias from sql
$col[“dbname”] = “nocall”; // grid column name, same as db field or alias from sql
$col[“show”] = array(“list”=>true, “add”=>true, “edit”=>true, “view”=>false, “bulkedit”=>false);
$col[“formatter”];
$col[“editable”] = true;
$col[“edittype”] = “checkbox”;
$col[“editoptions”] = array(“value”=>”1:0”);
$col[“hidden”] = false;
$col[“hidedlg”] = true;
$col[“export”] = false;
$col[“condition”] = array(‘$row[“nocall”] > 0’, “No Call”, “Called In”);
$cols[] = $col;

Abu Ghufran Staff answered 1 month ago

Hi,

I don’t understand your issue. I think your code is working as you wrote it. You put the condition that if the value of cell is not “No” (that also includes Yes) … show No2 and it is doing it.

I see another issue in it, instead of $row[st.driveable] it should be $row[driveable]. The dbname property is only used in filtering and sorting to solve ambiguity in sql query.

$col["condition"] = array('$row["driveable"] <> "No"', "No2","Yes2");

If you still think it’s unexpected, please explain little more.

PS: Yes, technical support is still there but customers with active subscriptions have priority.

 

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

4 + 11 =

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?