Solved

How to specify scrollbar thumb position in Flex

Posted on 2010-09-23
3
426 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will learn how to count occurrences of each item in an array.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now