laureen
11-14-2006, 01:01 PM
Hello to all,
i am trying to bind the following dynamic XML data structure to a DataGrid:
<data>
<object id="21" type="phone" state="0" name="Charly">
<object id="22" type="phone" state="1" name="Bob">
<object id="23" type="phone" state="9" name="Wendy">
</data>
this data structure is given by another software and is updated using XML Sockets. Lets say we call this "appdata". The "state" changes (by remote update) and shall also change inside the DataGrid.
The thing i got working:
<mx:XMLListCollection id="agentdata" source="{appdata.object.(@type == 'phone')}" />
<mx:DataGrid id="agents" dataProvider="{agentdata}">
<mx:columns>
<mx:DataGridColumn headerText="Phones" dataField="@name" />
</mx:columns>
</mx:DataGrid>
Now the problem:
Now i would like to create a dynamic DataGrid in Flex2 that shows the
contents of field "name". The cell showing the name should have a background color that depends on the field "state". Does anyone have an idea or can give a hint on how to handle this?
Thanks,
Laureen
i am trying to bind the following dynamic XML data structure to a DataGrid:
<data>
<object id="21" type="phone" state="0" name="Charly">
<object id="22" type="phone" state="1" name="Bob">
<object id="23" type="phone" state="9" name="Wendy">
</data>
this data structure is given by another software and is updated using XML Sockets. Lets say we call this "appdata". The "state" changes (by remote update) and shall also change inside the DataGrid.
The thing i got working:
<mx:XMLListCollection id="agentdata" source="{appdata.object.(@type == 'phone')}" />
<mx:DataGrid id="agents" dataProvider="{agentdata}">
<mx:columns>
<mx:DataGridColumn headerText="Phones" dataField="@name" />
</mx:columns>
</mx:DataGrid>
Now the problem:
Now i would like to create a dynamic DataGrid in Flex2 that shows the
contents of field "name". The cell showing the name should have a background color that depends on the field "state". Does anyone have an idea or can give a hint on how to handle this?
Thanks,
Laureen