This example illustrates how to use the RadSlider's Client-side API for item management.
The
RadSlider has methods that allow you to manage the control's items on the client when its property
ItemType is set to
Item:
-
addSliderItem(item, index)
- adds a new item to the RadSlider's client-side item collection at the specified index.
The settings of the item are configured by passing an object, which has properties text and value, as the item parameter of the method. If the index parameter is not set, the new item will be added at the end of the collection.
var
item = { text:
"New Item"
, value:
"1"
};
- removeSliderItem(index) - removes an item from the RadSlider's client-side item collection. If the index parameter is not set, the last item from the collection will be removed.
Important: The changes made using the above client-side methods will affect the client item collection only. They will not be persisted on the server and will be lost after postback.