Slider
The Slider component offers simple or range sliders. It is based on the angularjs-slider project.
Content under construction
Table of contents
Slider examples
Here is a screenshot of a form with a few sliders in action:
![](https://docs.servoy.com/~gitbook/image?url=https%3A%2F%2F3933488479-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FjpWd52BKwABWxF2lScUK%252Fuploads%252Fgit-blob-2ddbfee237ea58af6314d84dc162d527506b8f73%252Fexamples.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=3d818a10&sv=1)
Slider properties
Slider properties can be found here.
Function properties
Some properties above are named "Function" that take a string with the full function definition. Please not that a function reference to a Servoy function will not work (something like forms.abc.myMethod).
These functions are sent to the client as such and will execute client side. This reduces the roundtrips to the server.
Here is an example of the formattingFunction
that will divide each value by 1000 and display values with 1 decimal and a 'k' at the end, while tick values show without decimals:
Note: the example method above calls a method numberFormat
which formats a number with the given Servoy format. This method is always present client side and can be called by any function provided to the component.
This function has been entered in designer as a string as shown below:
![](https://docs.servoy.com/~gitbook/image?url=https%3A%2F%2F3933488479-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FjpWd52BKwABWxF2lScUK%252Fuploads%252Fgit-blob-af351dc33f113afa71066ba0c6e519ea93e2ff8e%252Fdeveloper_function.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=b06e1be5&sv=1)
Custom types
Gradient type
Gradient properties can be found here.
Slider events
Slider events can be found here.
Slider API
Slider API methods can be found here.
Custom styling
The Slider component consists of one <div>
containing the slider element. The outer div has the svy-slider-container
class attached, while the slider itself can be addressed using the svy-slider
class and/or the ones that were set via the styleClass property.
To address single items of the slider, these classes can be used:
element selector | summary |
---|---|
.svy-slider .rz-bar | the slider bar |
.svy-slider .rz-pointer | the pointer |
.svy-slider .rz-tick | a tick |
.svy-slider .rz-bubble | a label bubble |
Related Articles
The following articles are recommended for additional reading
Last updated