Hi Abu, in the col below I am using a select to have the user choose a status for a case, as you can see I don't allow them to select 'Completed'. This works great except all the cases that have status as completed, the field is blank.
Is there a way to apply this to the editoptions only but have display shoow everything?
$col = array();
$col["title"] = "Status"; // caption of column
$col["name"] = "Status"; // grid column name
$col["dbname"] = "l.Status"; // this is required as we need to search in name field, not id
$col["editable"] = true;
$col["width"] = "30";
$col["editrules"] = array("required"=>true); // and is required
$col["edittype"] = "select"; // render as select
# fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values("select distinct LeadStatus as k, LeadStatus as v from tbl_status Where tbl_status.LeadStatus <> 'Completed'");
$col["editoptions"] = array("value" => ":;".$str);
$col["formatter"] = "select"; // display label, not value
$col["formoptions"] = array("rowpos"=>"7", "colpos"=>"2");
$cols[] = $col;
Set following:
$str = $g->get_dropdown_values("select distinct LeadStatus as k, LeadStatus as v from tbl_status");
$col["editoptions"] = array("value" => ":;".$str);
$col["editoptions"]["onload"]["sql"] = "select distinct LeadStatus as k, LeadStatus as v from tbl_status Where tbl_status.LeadStatus <> 'Completed'";