0
votes

I'm rendering a DataGrid in Flex with four columns. The dataProvider for the DataGrid is an XMLListCollection. I've got this all working. In the last column however I am displaying a ComboBox by setting the DataGridColumn's itemRenderer for that particular column to a custom ComboBox. The dataProvider for the DataGrid does not have the items that I would like the ComboBox to be filled with. My question is how do I provide the ComboBox in the DataGridColumn have a different dataProvider than the DataGrid. Will I just ahve to loop through all the rows, grab the ComboBox from each row's last column and set them manually that way?

Here is the mxml for the DataGrid:

<mx:DataGrid dataProvider="{_ticketList}">
    <mx:columns>
        <mx:DataGridColumn width="220"
            dataField="@package_name"
            headerText="Package Name"
            sortable="false" />

        <mx:DataGridColumn width="166"
            dataField="@barcode"
            headerText="Ticket Barcode"
            sortable="false" />

        <mx:DataGridColumn width="100"
            headerText="Ticket Blocked"
            sortable="false"
            itemRenderer="foo.bar.CustomCheckBox" />

        <mx:DataGridColumn width="210"
            headerText="Reason"
            sortable="false"
            itemRenderer="foo.bar.CustomComboBox" />
    </mx:columns>
</mx:DataGrid>
1

1 Answers

0
votes

OK I figured this out.

I have a configuration class that holds variables that I want accessible by the system. In my CustomComboBox I just pull the data from that config class and set it as sthe dataProvider of the CustomComboBox