TSlider displays a slider for numeric input purpose. A slider consists of a 'track',
which define the range of possible value, and a 'handle' which can slide on the track, to select
a value in the range. The track can be either Horizontal or Vertical, depending of the {@link SetDirection Direction}
property. By default, it's horizontal.
The range boundaries are defined by {@link SetMinValue MinValue} and {@link SetMaxValue MaxValue} properties.
The default range is from 0 to 100.
The {@link SetStepSize StepSize} property can be used to define the
between 2 values inside the range.
Notice that this step will be recomputed if there is more than 200 values between the range boundaries.
You can also provide the allowed values by setting the {@link SetValues Values} array.
A 'Progress Indicator' can be displayed within the track with the {@link SetProgressIndicator ProgressIndicator} property.
The TSlider control can be easily customized using CssClasses. You can provide your own css file, using the
{@link SetCssUrl CssUrl} property.
The css class for TSlider can be set by the {@link setCssClass CssClass} property. Default value is "Slider HorizontalSlider"
for an horizontal slider, and "Slider VerticalSlider" for a vertical one.
If {@link SetAutoPostBack AutoPostBack} property is true, postback is sent as soon as the value changed.
TSlider raises the {@link onValueChanged} event when the value of the slider has changed during postback.
You can also attach ClientSide javascript events handler to the slider :
- ClientSide.onSlide is called when the handle is slided on the track. You can get the current value in the
javascript variable. You can use this event to update on client side a label with the current value
- ClientSide.onChange is called when the slider value has changed (at the end of a move).
getAutoPostBack()
публичный Метод
public getAutoPostBack ( ) : boolean |
Результат |
boolean |
a value indicating whether an automatic postback to the server
will occur whenever the user modifies the slider value. Defaults to false. |
loadPostData()
публичный Метод
This method is primarly used by framework developers.
raisePostDataChangedEvent()
публичный Метод
This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface.
It is invoked by the framework when {@link getValue Value} property
is changed on postback.
This method is primarly used by framework developers.
renderContents()
публичный Метод
setAutoPostBack()
публичный Метод
An automatic postback to the server will occur whenever the user
modifies the slider value.