Hi there,
I'm trying to set a default value from an array to be shown in grid.
$array = array(1=>"Val 1"…);
$col["name"] = "col"; // this has numerical value
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>[operation with array]);
$col["default"] = $array["{col}"];
Off course the above example it's shown value of "col" (1,2..) not the $array["{col}"] (Val 1, Val 2…). But the add/edit it is ok. How do I make this working?
Thank in advance.
2 Answers
You can remove "default" and set formatter.
$col["formatter"] = "select";
This is show the label as display, and id for postback purpose.
Your Answer