Conditional Data set value?

QuestionsConditional Data set value?
Gary Brett asked 9 years ago

Hi Abu, I have a column which is a select type with values of 0 & 1. I have another column with date in like 12-08-15.

Am I able to set lead_status as 1 if leaddays = todays date? Looked at conditional data but couldn't get it working?

$col = array();
$col["title"] = "Status";
$col["name"] = "lead_status";
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>'1:Turn Leads On;0:Turn Leads Off');
$cols[] = $col;

$col = array();
$col["title"] = "Off Until";
$col["name"] = "leaddays";
$col["editrules"] = array("required"=>true);
$col["formatter"] = "date";
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d-m-Y');
$col["formoptions"] = array("elmsuffix"=>'<font color=red> *</font>');
$cols[] = $col;

Thanks

1 Answers
Abu Ghufran answered 9 years ago

You can set following with lead_status column.

$col["on_data_display"] = array("display_val","");
function display_val($data)
{
if ( $data["leaddays"] == date("Y-m-d") )
return 1;
else
return 0
}

It should work as formatter at display list mode.

Your Answer

1 + 2 =

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?