Often we need a ComboBox item renderer in a dataGrid column.
useful, the ComboBox needs to display the currently selected
each row, must update the dataProvider item when the user
option in the drop list, and must optionally be able to get
list items dynamically from the main dataProvider item.
The attached example uses an extended ComboBox to do the item
There are so many possible ways to structure data that a
solution is very difficult to envision. I approached this by
abstracting the "setup" into itemRenderer "wrappers". The
specifying both the list dataProvider source, and the "field"
list dataProvider items that contains the option values.
sample three renderers, each using a different main
different ways to get the ComboBox list items. Unless you can
intelligence into your data to specify the location and
structure of the
drop list dataProvider, you will almost certainly need a
each ComboBox column
The requirements for functionality and abstraction make this
bit complex, consisting of 5 files, but each component is
so take a look if you need this functionality. The renderers
I am not using this in production anywhere, so consider it
Zip file contents:
TestCBORenderer.mxml -- The test app
ComboBoxSelectedValue.mxml -- provides the value to list
DGIR_DynamicDP.mxml -- DataGrid ItemRenderer with dynamic CBO
DGIR_DynamicDP_XML.mxml -- DataGrid ItemRenderer with dynamic
DGIR_StaticDP_XML.mxml -- DataGrid ItemRenderer with Static
CBO List in
This is implemented in heavily commented mxml, with
everything in the
same folder, for simplicity as an example.