In the table I am using for the phpgrid, one of the fields is a foreign key to a reference table. Rather than displaying the key value in the cell, I want to display the value from the reference table.
For example, rather than displaying season_id = “1”; which is a foreign key to the reference table “seasons”, I want to display “Fall”, which is the value in the reference table associated with the primary key of “1”,
Another way to illustrate, is I want to use code like this below, but not for Search Options, instead for the cell’s display value:
/ Fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values(“select distinct season_id as k, season_descr as v from seasons”);
$col[“stype”] = “select”;
$col[“searchoptions”] = array(“value” => $str, “separator” => “:”, “delimiter” => “;”);
What would be the array attribute to use instead of “searchoptions”?
Solved it myself, with another read through of the documentation. //season $col = array(); $col[\\\”title\\\”] = \\\”Season\\\”; $col[\\\”name\\\”] = \\\”season_id\\\”; $col[\\\”width\\\”] = \\\”20\\\”; $col[\\\”editable\\\”] = true; $col[\\\”edittype\\\”] = \\\”select\\\”; $col[\\\”editoptions\\\”] = array(\\\”value\\\”=>\\\’1:Fall;2:Winter;3:Spring\\\’); $cols[] = $col;