your datagrid dataprovider is a reference to a collection (in your 
case its an XMLListCollection). 
so if your removing items from it .....and your also referencing 
this same collection elsewhere, then ofcourse you will be see the 
same items being removed (because your looking at the same 
collection)

unless anyone has a better idea, you'll have to make a 'copy' of 
your xmllistcollection and make that your datagrids 
dataprovider....and then you'll be able to remove items as you like 
without any loss of data in other parts of your work.


sound okay?
bod

--- In flexcoders@yahoogroups.com, "grae_hall" <[EMAIL PROTECTED]> wrote:
>
> I've got a datagrid component which I'm using to display the most 
> recent documents from an XML file. It's an XMLListCollection. I 
think.
> 
> I've worked out how to do the sort()/refresh() stuff on it, and 
> that's working as expected.
> 
> However, there's the potential for there to be in excess of 1000 
> documents references in the XML file.
> 
> I'd like to limit the xmllistcollection I use for "my recent 
> documents" to a set number - I'm just unsure of the syntax. I 
tried 
> iterating through the XMLListCollection with a for i ++ loop, 
> starting 'i' at the number I wanted - and then removedItemsAt(i) - 
> but that appears to have affected the other XMLListCollection I 
use, 
> of the same XMLList - to search all of the documents. So instead 
of 
> getting back a lot of results, in my other datagrid component 
based 
> on search, I only get back a maximum of whatever I set 'i' to in 
the 
> for loop on the recent documents.
> 
> So - how do I limit my results, and how do I interact with 
> XMLListCollections properly so that I don't change the loaded 
XMLList 
> underneath, that's referenced in other XMLListCollections?
> 
> Your help in this regard - my fellow flex monkeys, would be 
greatly 
> appreciated.
> 
> If I check mail-archive in a month, and see that this, like many 
> useful questions posed on this list, received no replies, I'll 
feel 
> quite despondent.
> 
> True story.
> 
> Grae Hall
> 
> Senior Designer
> www.daemon.com.au
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to