Hi Abu, wonder if the grid is able to allow this? I have a field called 'leaddays' that holds a date in uk format. Is it possible to set another checkbox field 'lead_status' if the date in first columns has passed?
For example if date has past in 'leaddays' 17-04-2016, then the checkbox in 'lead_status' is ticked?
$col = array();
$col["title"] = "Status";
$col["name"] = "lead_status";
$col["width"] = "20";
$col["edittype"] = "checkbox";
$col["editoptions"] = array("value"=>"1:0"); // with these values "checked_value:unchecked_value"
$col["formatter"] = "checkbox";
$cols[] = $col;
$col = array();
$col["title"] = "Off Until"; // caption of column
$col["name"] = "leaddays"; // grid column name
$col["formatter"] = "date";
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'d-m-Y');
$col["formoptions"] = array("elmsuffix"=>'<font color=red> *</font>');
$cols[] = $col;
Many thanks
With lead_status column, you can set custom data display event, e.g.
$col["on_data_display"] = array("set_custom_data","");
function set_custom_data($data)
{
$date = $data["leaddays"];
if( strtotime($date) > strtotime('now') )
$data["lead_status"] = 1;
else
$data["lead_status"] = 0;
}