I have a datagrid in my code that looks like this:
<s:DataGrid id="dg">
<s:ArrayCollection id="ac">
<s:DataItem ../>
<s:DataItem ../>
</s:ArrayCollection>
</s:DatGrid>
I am trying to have a separate label (by default) show the data from a particular cell after sorting the data in a particular way.
For Example:
DataGrid shows:
Date Type
---- ----
8 yes
12 no
6 this
7 that
Label: 6 (First date after sorting in ascending order)
Any easy way I can do this in ActionScript (or otherwise)? Should I try to work with the ArrayCollection component or the DataGrid?
Thanks,
Figured it out, using the sorting ArrayCollection reference. Used two different methods for sorting and extracting:
Sorting:
Extraction:
Then its just a matter of calling the functions appropriately: