Solved

How to specify scrollbar thumb position in Flex

Posted on 2010-09-23
3
430 Views
Last Modified: 2013-11-11
Is there a way I can make a scrollbar thumb jump to a certain location so as to display the appropriate records applicable within its range? For example, if a datagrid that displays 10 records at a time had 500 records, scrolling the scroll bar thumb exactly at the center should roughly display the 245th to 255th records.

In order to do this, I'm guessing I would need to be able to get the beginning and end range of a scrollbar thumb. I'm sure one side has to be 0, but how do I get the END range value of a scrollbar thumb?

And secondly, how can I manually position the scrollbar thumb within the scrollbar?

Does anyone have any experience doing this? Thanks.
0
Comment
Question by:elepil
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
heppa earned 500 total points
ID: 33752095
Hey.

simply use:

dataGrid.validateNow();
dataGrid.verticalScrollPosition = 50;

this will put element 50 as top visible element.

To find out about the number you wish to scroll to is simple math ;)
0
 
LVL 4

Expert Comment

by:heppa
ID: 33753491
btw: there is a property dataGrid.maxVerticalScrollPosition that has the value of the last item to scroll to (normally means itemCount - gridSize).

good luck!
0
 

Author Closing Comment

by:elepil
ID: 33754693
That was perfect! Thank you!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question