Indeed, a VScrollBar has really a lot of flexibility! I succeeded in
subscribing to it's events and using the event.preventDefault()
method cancel it's other listeners and it's actions.
Using the configureScrollBars() method, the scrollbar sizing can
easily be configured:
override protected function configureScrollBars():void
{
setScrollBarProperties(something, something, totalRowCount,
rowCount);
}
Where "totalRowCount" is your total number of records in the table
(let's say 1000000) and "rowCount" is existing DataGrid's property
which returns the number of currently VISIBLE rows in the grid. This
value updates every time the grid is resized, so that's the answer
to your question of counting rows.
(rowCount/totalRowCount makes the size of a thumb compared to a
height of a scrollbar)
I've taken a look at your grid - you are basically extending a
Canvas and laying out a DataGrid and "indipendant" VScrollBar on
that canvas.
My goal is to extend a DataGrid and use only its features.. and till
now it goes well. I prevented default sorting by header click and
refreshing data on scrollbar events. So now I've got something like
a "DeadGrid" :-) In which clicking headers and moving a scroller
does nothing except raising events which trigger server-side
procedures that fetch a fresh data based on a ScrollEvent.position
and grid.sort. On dataProvider REFRESH event, fresh data is loaded
into the grid..
--- In [email protected], "Paul DeCoursey" <[EMAIL PROTECTED]> wrote:
>
>
> --- In [email protected], "Danko Kozar" <danko.kozar@>
wrote:
> >
> > I am testing both of this examples, thanks..
> >
> > Question: is there any possibility to control the DataGrids
> > scrolling thumb position and height?
> >
> > Because this way a page size would be fixed (rows not scrolling
at
> > all) and the scroller would be used just for navigation through
> > pages (instead of the "breadcrumbs" section above the grid). It
> > would also give an info of current page / total pages.
> > It would be nice if the scroller position and height could be
set in
> > percentage (e.g. positionFromTop=20, height=10) while the loaded
> > rows count is always equal to grid rows count.
>
> yes, well probably, the VScrollBar has a lot of flexability in it's
> display. To be honest this is the first time I've ever used one
> directly and I haven't explored it fully. But you should be able
to
> get it to work the way you want it too.
>
>
> >
> >
>