Reputation:
I have an array in Flash 8 that is used to populate a DataGrid using:
myDataGrid.dataProvider = myArray;
This works fine. I can sort the data in the grid using the headers, but this also sorts the data in the source array. Also, I have other functions that need to get the array data in its original unsorted form.
Any idea how to achieve this?
Many thanks
Upvotes: 0
Views: 236
Reputation: 2057
just duplicate the variable before you use it as the dataProvider.
var myDataProvider:Array = myArray
myDataGrid.dataProvider = myDataProvider
changes to one of these arrays won't effect the other.
Upvotes: 1