0
votes

I have a datagrid, which gets filled by an ArrayList. I want one column to be filled by another ArrayList. I've tried doing it like this, but that only gets the first three columns filled, not the last one (with the different ArrayList):

<s:DataGrid x="10" y="281" width="597" height="204" dataProvider="{arEvents}"
            requestedRowCount="4">
    <s:columns>
        <s:ArrayList>
            <s:GridColumn dataField="title" headerText="Column 1" ></s:GridColumn>
            <s:GridColumn dataField="venue.location.geopoint" headerText="Column 2"></s:GridColumn>
            <s:GridColumn dataField="startDate" headerText="Column 3"></s:GridColumn>
            <s:GridColumn dataField="{arArtistsPerEvent}" headerText="Column 3"></s:GridColumn>
        </s:ArrayList>
    </s:columns>
</s:DataGrid>
1

1 Answers

1
votes

No, it is not possible. That would break the very purpose of a datagrid and dataprovider.

One solution would be to parse the second list and put its values in the first one.

for(var i:int=0; i<arArtistsPerEvent.length; i++) {
    arEvents.getItemAt(i).artistsPerEvent=arArtistsPerEvent.getItemAt(i);
}

and then have the dgColumn like

<s:GridColumn dataField="artistsPerEvent" headerText="Column 3"></s:GridColumn>