In order for a filter function to eliminate unwanted items ­ everything in
your data provider will have to pass through that function... which probably
won¹t perform well as the number of records increase. If you aren¹t dealing
with large amounts of data it probably isn¹t a concern (just a thought).

On the flip-side you could use a paged ArrayCollection. There is a good
example on Adobe Developer Connection written by Peter Molgaard if you¹re
interested.

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&pro
ductId=2&postId=11083


Cheers,

Rick Winscot




On 5/29/09 10:59 AM, "fumeng5" <[email protected]> wrote:

>  
>   
> 
>   
> 
> Hi,
> 
> I'm looking for help writing an algorithm in a filter function I am using.
> Here's the situation: Based on a page number and a number of records per page,
> I want to return all indexes that fall within a certain range. There are 4
> records per page.
> 
> For example;
> 
> - page 1 will return indexes 0-4
> - page 2 will return indexes 5 - 9
> - page 3 will return indexes 10 - 14
> ....etc, etc...
> 
> So, here are the vars:
> 
> var index:int = myCollection.getItemIndex( item );
> var recordsPerPage:int = 4;
> 
> It's embarrassing, but this is what I have so far....
> 
> if( page <= index < (page * page + recordsPerPage) )
> return true
> 
> Can anyone offer some helpful insight, please?
> 
> Thank you for any help.
> 
>        
> 
>   
>     
> 
>> 

Reply via email to