tags:

views:

80

answers:

1

I have an array in flash 8 that is used to poulate 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 array, and I have other functions that need to get the array data in its unsorted form.

Any idea how to achive this?

Many thanks

A: 

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.

shit a birck
OK, I can see that this may help, but what happens when I add an entry to the original array? I can reassign to the data provider and relink to the datagrid, but then if the user is doing anything with the datagrid, they will lose what they are doing as it gets reloaded.What I really need is a way to have multiple views of the data so that the user can look at one sort in the grid but then other parts of my software can request the data in a different sort order (ie theoriginal unsorted version.Are there any methods of doing this?Thanks for your reply.