Recalling in Access, I am able to define a grid with a dropdown box which displays one item but is storing another. We are familiar with the dDropdownList and dComboBox in 'Key' Mode to do this outside of the grid.
This attached file (also contains code from ticket 1138: http://trac.dabodev.com/ticket/1138)
contains a new CustomRenderer? and CustomEditor?.
In order to use this functionality, you need to subclass both:
* gGridDropdownListEditor
* gGridDropdownListRenderer
and override the methods:
* getKeys()
* getChoices()
to return an array of corresponding keys and choices. These functions are used by gGridDropdownListEditor when creating the DropdownList? to assign the Keys and Values property, and gGridDropdownListRenderer to display the appropriate value.
Once you've subclassed the above classes, simply set:
* col.CustomEditorClass? = <your subclass of gGridDropdownListEditor>
* col.CustomRendererClass? = <your subclass of gGridDropdownListRenderer>
where col is a dabo.ui.dColumn used in a dabo.ui.dGrid
You can run the attached file directly to see an example (in the second column). It was really only slapped together for my testing purposes. I appologise if the contents and structure are a bit untidy, I keep a lot of commented out code about for further testing.
These are still rough but please experiment with and see if they meet anyones needs.
Thanks to the dabo team for their examples and the entire dabo library. I hope someone finds these beneficial.