thanks man it worked great.....

On Thu, Jan 13, 2011 at 1:58 AM, Bobbyinsane <[email protected]> wrote:

> var records:Array = [{a:1,b:2},{a:1,b:2},{a:1,b:2},{a:1,b:2},{a:1,b:2},
> {a:1,b:2},{a:1,b:2}]; // replace with your collection
>
> var theCount:int = records.length; // total num records
> var recordsPerPage:int = 5; //total records to be displayed on each
> page
> var totalPages:int = Math.ceil(theCount/recordsPerPage); // caluculate
> the total possible pages, Ceil it to get the items from the remainder
> page
>
> theSlider.min   = 1; // set the slider min
> theSlider.max  = totalPages; // set the slider max
> theSlider.step  = 1; // each step one page
>
> var currentPageCount = theSlider.value; // on chage get slider value
>
> var recEndIdx  = recordsPerPage * currentPageCount; // caluculate the
> end index of the pagee
> var recEndIdx  = recEndIdx < recordsPerPage ? recordsPerPage :
> recEndIdx; // handle index out of range exeption
>
> var recStartIdx = recEndIdx - recordsPerPage ; // caluculate the start
> index of the page
> var recStartIdx = recStartIdx < 0 ?  0 : recStartIdx; // handle index
> out of range exeption
>
> theGrid.dataProvider = new ArrayCollection(records.slice(recStartIdx,
> recEndIdx)); // finaly exract the page, return as new collection as
> data provider
>
>
> is this of any help? :)
>
>
> Bobbyinsane
> http://www.insanepixel.com
>
>
> On Jan 10, 9:49 am, karthi <[email protected]> wrote:
> > Hi all,
> >
> > I am populating datagrid using httpservice with xml result object. and
> > also vsilder for my application,I wanted to know how to do the
> > datagrid paging from slider change event
> > I had googled almost more than 3 days , can't find an answer. Can
> > anybody help me on this?
> > Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to