Hi!
I am making a list where i am choosing users for particular events. I want the list to save a User_ID – but to show the name. I cannot find out how to do that.
Here is what i write:
$col = array();
$col["title"] = "Customer Account Manager";
$col["name"] = "CustomerAccountManagerId";
$col["editable"] = true;
$col["width"] = "80";
$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 User_Id as k, User_Name as v from user where UserGroup=6");
$col["editoptions"] = array(
"value"=>$str,
"onchange" => array(
"sql"=>"select * from user",
"search_on"=>"User_Id",
"callback" => "fill_form" )
);
$col["stype"] = "select"; // enable dropdown search
$col["searchoptions"] = array("value" => ":;".$str);
$cols[] = $col;
And – when i use the dropdown i see the name – but i want to see the name in the list also – but save the UserID.
Hope you can assist.
/Mattias