Hello Abu,
I need to have a select value for the add operation, but once set the value must be read only.
I tried:
$lstAll = $g->get_dropdown_values( “select xis.item_code as k, xis.item_code as v
from table xis
order by xis.item_code”);
$lstAll = “:;”.$lstAll;
$col = array();
$col[“title”] = “Item”;
$col[“name”] = “ITEM_CODE”;
$col[“hidden”] = false;
$col[“width”] = “120”;
$col[“fixed”] = true;
$col[“visible”] = “xs+”;
$col[“editable”] = true; ##Will be made editable on Add by option’s hook
$col[“edittype”] = “select”; ##Select item from list
$col[“editoptions”] = array(“value”=>$lstAll); ##List all Items
$col[“editrules”] = array(“required”=>true, “readonly”=>true); ##Make it read-only after insert
$col[“default”] = “{ITEM_CODE}”; ##Initialize with selected value
$col[“search”] = true; ##Column is searchable
$col[“searchoptions”][“sopt”] = array(“bw”); ##Text search “Begin with…”
$col[“export”] = true;
$col[“autoid”] = false;
$cols[] = $col;
It looks to work well, but on edit form the Item field is always the first element of $lstAll and not the current value of ITEM_CODE.
How can I achieve the correct behavior (i.e. add ==> select from list, edit ==> read_only value reflecting the added value)?