I am new to Flex, and while implementing one of our projects,
I am facing one issue.
I have designed a datagrid with 3 columns which will get data
from the data provider, and one column for combobox as below
So, when I get 4 records from the'gridData', 3 combobox will
also come in the 'New Area' column.
User has the option of updating area bu selecting one of the
options in the Combobox, and click in 'Save' button.
The problem is that, when there are more records, datagrid
get scrollbar to scrollbar.
If I select an option for the first record, and scrolldown
to last records, and do any selection for the last record's
comboboxes, then the first record's combox selection is also
I am not understanding the problem, It may be due to the
event handling i don't know.
Can anyone give any suggession on this to resolve.
The problem you are seeing is because item renderers are
"recycled". Only the visible renderers, plus a few for buffering.
are actually instantiated. When you scroll, each visible renderer
is re-drawn with the values from the new item "underneath" it.
The solution is to have the itemRenderer update the
dataProvider item when the user changes a value, and have the
renderer's components state set by values in the dataProvider item.
This is a bit complicated with the Combo box, because yo will
need to progrmatically set the selectedIndex of the combobox within
the renderer. While possible, it will be difficult to do this in an
in-line renderer, I advise creating a component.
Google this , there are many examples of itemRenderers