Hi,
I am having a problem with 2 get_dropdown_values() in the same grid.
when the grid renders and I want to add a record, I can see the correct dropdowns.
However when I press the Submit button the record is added without the value for the first drop down. I changed the order of the columns and it's always the first column that is not working. I can't figure it out. Has anyone had something similar?
Here's is my columns code:
unset($cols);
$col = array();
$col["title"] = "Sales Person";
$col["name"] = "salesperson_id";
$col["viewable"] = true;
$col["editable"] = true;
$col["edittype"] = "select"; // render as select
$col["dbname"] = "aps_users.username";
$str = $grid3->get_dropdown_values("SELECT spid AS k, personname AS v FROM salespeople_sp LEFT JOIN aps_users ON aps_users.username=salespeople_sp.personname WHERE aps_users.usertype =1");
$col["editoptions"] = array("value"=>$str);
$col["searchoptions"] = array("value" => $str, "separator" => ":", "delimiter" => ";");
$col["formatter"] = "select"; // show label in grid, instead of value
$col["search"] = true;
$cols[] = $col;
$col = array();
$col["title"] = "Sales Assistant";
$col["name"] = "assistant_id";
$col["editable"] = true;
$col["viewable"] = true;
$col["edittype"] = "select"; // render as select
//$col["dbname"] = "aps_users.username";
$str = $grid3->get_dropdown_values("SELECT id AS k, username AS v FROM aps_users WHERE usertype=2 AND status=1");
$col["editoptions"] = array("value"=>$str);
$col["searchoptions"] = array("value" => $str, "separator" => ":", "delimiter" => ";");
$col["formatter"] = "select"; // show label in grid, instead of value
$col["search"] = true;
$cols[] = $col;
$col = array();
$col["title"] = "Active?";
$col["name"] = "active";
$col["viewable"] = true;
$col["editable"] = true;
$col["width"] = "50";
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>'0:No;1:Yes');
$cols[] = $col;