multiple get_dropdown_values in the same grid

Questionsmultiple get_dropdown_values in the same grid
Amir asked 5 years ago

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;

1 Answers
Amir answered 5 years ago

Never mind. I forgot to add the first column as ID.

Your Answer

14 + 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 / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!