listObj.scrollToClosestValue Method
Syntax
Arguments
- valueany
The List value to scroll into view. This is based on the value the List returns. For example, if the List is set to return the value from a 'Lastname' field and you specify value as 'M', the first record that has a 'Lastname' field that begins with 'M' will be scrolled into view.
- flagCaseInsensitiveboolean
Default value is true. A true/false value. If value is true, a case insensitive search is performed. If value is false, a case sensitive search is performed.
- positionstring
Position of the target row. Can be one of the following values:
- Position
- Description
- "top"
Target row should appear at the top of the List.
- "bottom"
Target row should appear at the bottom of the List.
- "in-view"
Target row can appear anywhere in the List as long as it is visible on screen.
- animationObjectobject
When the List is scrolled, it can be animated. The object has the following properties:
- Animation Property
- Description
- allow
A true/false value. If true, animation will be used. If false, animation will not be used.
- duration
The animation duration in milliseconds.
Description
Scrolls the closet record into view in the List.
Example
//Scroll the List so that the first Customer with a Lastname //starting with 'M' is shown at the top of the List var listObj = {dialog.object}.getControl('list1'); if (listObj) { var value = "m"; var flagCaseInsensitive = true; var position = "top"; var animation = {allow: true, duration: 200}; listObj.scrollToClosestValue(value,flagCaseInsensitive,position,animation); }