Hi Andrew,
Try this logic.
So have an object which holds the sorting details, and another object/array
which holds the unique ID/s of the selected rows.

Now just implement the dataProvider of the new set on each data load. Then
set the sorting and select the ID with try catch as the ID which you already
selected might not be in the list.

I guess, this will be faster and optimized based on sorting procedures as
well.


Warm Regards
Deepanjan Das
W: http://deepanjandas.wordpress.com
|| Om Manasamarthadata Shri Aniruddhaya Namah
||<http://www.manasamarthyadata.com/>
*Think of the environment before printing this email
__________________________________________________________________________
*


On Fri, Apr 22, 2011 at 1:52 AM, Andrew Sinning <and...@learningware.com>wrote:

> I have a screen with a DataGrid that displays "live" data, that is,
> data which is constantly changing.  It's not a very large amount of
> data, so I just make a query to the server every 2 seconds to get the
> new data.
>
> When the new data comes in, the easiest thing to do would be to simply
> set the dataProvider of the DataGrid to the new data, but this is
> really crude.  For starters, if over-writes imports properties such as
> how the array is sorted and which items are selected.
>
> So, to correct for these problems, what I do is iterate through each
> item in the dataProvider of the DataGrid, find the corresponding item
> in the new data and copy its properties to the item in dataProvider,
> remove any items from the dataProvider that are not in the new data,
> and then add any items from the new data that aren't in the
> dataProvider.
>
> Needless to say, this is terribly inefficient.
>
> So, what should I be doing?  This has to be done in AS2 because it is
> being incorporated in a legacy application.
>
> Thanks!
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to