Rangeslider"

From Documentation
(Created page with "{{ZKComponentReferencePageHeader}} = Rangeslider = *Demonstration: *Java API: [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zkmax/zul/Rangeslider.html Rangeslider] *JavaS...")
 
Line 10: Line 10:
 
= Employment/Purpose =
 
= Employment/Purpose =
  
This component synchronizes the scrolling position on a page or within ZK containers (Div, Window, etc.) with hyperlinks and buttons. It allows you both to navigate to desired ZK components in a page and highlight the current navigation link based on the current scroll position.
+
A rangeslider component represents a slider with a range value. It can be used to let user select a start value and end value. A rangeslider accepts a range of value starting from 0 to certain maximum value. The default maximum value of rangeslider scale is 100. You could change the maximum allowed value by the max property. Notice that the value of max property is always larger than the value of min property.
  
 
= Example =
 
= Example =
Line 16: Line 16:
 
<source lang="xml" >
 
<source lang="xml" >
 
<zk xmlns:ca="client/attribute">
 
<zk xmlns:ca="client/attribute">
   <anchornav name="a1" width="250px">
+
   <rangeslider startValue="10" endValue="90"/>
        <listbox>
 
            <listitem><listcell><a ca:data-anchornav-target="$win1"> First Window </a></listcell></listitem>
 
            <listitem><listcell><a ca:data-anchornav-target="$win2"> Second Window </a></listcell></listitem>
 
            <listitem><listcell><a ca:data-anchornav-target="$win3"> Third Window </a></listcell></listitem>
 
        </listbox>
 
    </anchornav>
 
  <window id="win1" title="1. First Window">
 
    Hello world.
 
  </window>
 
  <window id="win2" title="2. Second Window">
 
    Welcome to ZK world.
 
  </window>
 
 
</zk>
 
</zk>
 
</source>
 
</source>
  
By default, the Anchornav component will watch the scroll position of a page.
+
= Properties =
Other scrollable containers can be associated with a named Anchornav by setting the client-attribute: ca:data-anchornav-scroll.
 
  
For example:
+
== Disabled ==
<source lang="xml" >
+
 
<div ca:data-anchornav-scroll="a1">
+
== Orient ==
    <!-- other components -->
+
Sets the orient either "horizontal" or "vertical" to display rangslider.
</div>
+
 
</source>
+
== Marks ==
 +
Sets the marks information for displaying value marks.
 +
(Default: "20")
 +
If there is only a number value, for example: 20.
 +
The value marks would be displayed every 20 start from the minimum value. (if min is 0, then display "0 20 40 ...")
 +
Another options for the marks can be specified as follows:
 +
<source lang="xml" ><rangeslider marks="10:10%, 20:20%, 50:50%, 80:80%" /></source>
 +
It means that each value mark could be displayed in different text.
 +
 
 +
== Max ==
 +
Rangeslider supports maximal position, which can be changed by the max property as follows.
 +
(Default: 100)
  
A or Button components can be used as links and targets are specified by the ZK client-attribute ca:data-anchornav-target=[selector].
+
== Min ==
For example, in Line 3 and Line 4, $win1 / $win2 select widgets by zk component id, win1 / win2.
+
Rangeslider supports minimal position, which can be changed by the min property as follows.
 +
(Default: 0)
  
The JQuery-based selector syntax (#domId / .class / elementName) is extended by ZK specific selectors as seen above using $componentId or @componentName.
+
== StartValue, EndValue ==
 +
Represent the range value of Rangeslider.
 +
(Default: 0)
  
= Properties =
+
== Step ==
 +
By default, the rangeslider will scroll to the position continuously when an user drags it. If you prefer to scroll a discrete fixed amount on each step, you can set the amount of value of the step property.
  
== Name ==
+
== TooltipVisible ==
Set the name of Anchornav, it is only required when we want to spy scrolling in ZK containers instead of the whole page scrollbar.
 
  
== PositionFixed ==
+
=Supported Events=
Set whether to enable position fixed when anchornav is out of current view. When it is set to true, Anchornav will stay (float) on the same position of the page. (Default: true)
 
  
= Supported Events =
+
{| border="1" | width="100%"
 +
! <center>Name</center>
 +
! <center>Event Type</center>
 +
|-
 +
| <center>onScroll</center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.ScrollEvent</javadoc>
 +
Denotes the content of a scrollable component has been scrolled by the user.
 +
|-
 +
| <center>onScrolling</center>
 +
| '''Event:''' <javadoc>org.zkoss.zk.ui.event.ScrollEvent</javadoc>
 +
Denotes that the user is scrolling a scrollable component. Notice that the component's content (at the server) won't be changed until onScroll is received. Thus, you have to invoke the <tt>getPos</tt> method in the ScrollEvent class to retrieve the temporary position.
 +
|}
 +
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]
  
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/LabelImageElement#Supported_Events | LabelImageElement]]
 
  
= Supported Children =
+
=Supported Children=
  
  *[[ZK_Component_Reference/Essential_Components/Nav | Nav]], [[ZK_Component_Reference/Essential_Components/Nav/Navitem  | Navitem]],[[ZK_Component_Reference/Essential_Components/Nav/Navseparator  | Navseparator]]
+
  *None
  
 
= Use Cases =
 
= Use Cases =
Line 81: Line 92:
 
| 9.0.0
 
| 9.0.0
 
| November, 2019
 
| November, 2019
| [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zkmax/zul/Anchornav.html Anchornav] was introduced.
+
| [http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zkmax/zul/Rangeslider.html Rangeslider] was introduced.
 
|}
 
|}
  
 
{{ZKComponentReferencePageFooter}}
 
{{ZKComponentReferencePageFooter}}

Revision as of 10:10, 12 November 2019

Rangeslider

Employment/Purpose

A rangeslider component represents a slider with a range value. It can be used to let user select a start value and end value. A rangeslider accepts a range of value starting from 0 to certain maximum value. The default maximum value of rangeslider scale is 100. You could change the maximum allowed value by the max property. Notice that the value of max property is always larger than the value of min property.

Example

<zk xmlns:ca="client/attribute">
  <rangeslider startValue="10" endValue="90"/>
</zk>

Properties

Disabled

Orient

Sets the orient either "horizontal" or "vertical" to display rangslider.

Marks

Sets the marks information for displaying value marks. (Default: "20") If there is only a number value, for example: 20. The value marks would be displayed every 20 start from the minimum value. (if min is 0, then display "0 20 40 ...") Another options for the marks can be specified as follows:

<rangeslider marks="10:10%, 20:20%, 50:50%, 80:80%" />

It means that each value mark could be displayed in different text.

Max

Rangeslider supports maximal position, which can be changed by the max property as follows. (Default: 100)

Min

Rangeslider supports minimal position, which can be changed by the min property as follows. (Default: 0)

StartValue, EndValue

Represent the range value of Rangeslider. (Default: 0)

Step

By default, the rangeslider will scroll to the position continuously when an user drags it. If you prefer to scroll a discrete fixed amount on each step, you can set the amount of value of the step property.

TooltipVisible

Supported Events

Name
Event Type
onScroll
Event: ScrollEvent

Denotes the content of a scrollable component has been scrolled by the user.

onScrolling
Event: ScrollEvent

Denotes that the user is scrolling a scrollable component. Notice that the component's content (at the server) won't be changed until onScroll is received. Thus, you have to invoke the getPos method in the ScrollEvent class to retrieve the temporary position.


Supported Children

*None

Use Cases

Version Description Example Location
     

Version History

Last Update : 2019/11/12


Version Date Content
9.0.0 November, 2019 Rangeslider was introduced.



Last Update : 2019/11/12

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.