Can/How do you get the edit options for edit type "Select" from a data base instead of hard coding?
John — Here's how I did it:
// Edit options declaration in "Select" column:
$Col['editoptions'] = array('value'=>$Db->CodeOptions('ROWSTATUS'));
// Function to fill the select options:
public function CodeOptions($CodeType) {
$CodeType = strtoupper(trim($CodeType));
$Options = '';
$Result = $this->SQLSelect('select CodeValue, Description
from wb_code
where CodeType = "' . $CodeType . '" and RowStatusID = 1
order by CodeValue');
while ($Row = mysql_fetch_assoc($Result)) {
$Options .= $Row['CodeValue'] . ':' . $Row['Description'] . ';';
}
// Drop the last semicolon.
$Options = substr($Options, 0, strlen($Options) – 1);
// Return string something like "1:Active;2:Inactive;3:Deceased"
return($Options);
}
Hope this helps!