I am succeding in changing tick labels on a slider called on javascript
Work!
But, I would like to do the same trick on a Slider generated by an asp helper
unfortunately, it does not work.
Any ideas?
<
script
>
$(document).ready(function () {
var slider = jQuery("#slider").kendoSlider({
increaseButtonTitle: "Right",
decreaseButtonTitle: "Left",
showButtons: true,
min: 1,
max: 4,
largeStep: 1,
tooltip: {
enabled: false
},
orientation: "horizontal"
});
var steps = {};
steps[0] = 'very low';
steps[1] = 'medium';
steps[2] = 'hight';
var sliderItems = slider.siblings(".k-slider-items");
$.each(steps, function (index, value) {
var item = sliderItems.find("li:eq(" + (index) + ")");
item.attr("title", value);
item.find("span").text(value);
});
});
</
script
>
<
div
id
=
"slider"
>
</
div
>
Work!
But, I would like to do the same trick on a Slider generated by an asp helper
@(Html.Kendo().Slider()
.Name(
"nameSlider"
)
.IncreaseButtonTitle(
"Right"
)
.DecreaseButtonTitle(
"Left"
)
.Min(0)
.Max(3)
.SmallStep(1)
.Value(0)
.Orientation(SliderOrientation.Horizontal)
.HtmlAttributes(
new
{ @class =
"balSlider"
})
.Deferred()
)
@Html.Kendo().DeferredScripts()
<script>
$(document).ready(
function
() {
var
selectedSlider = $(
"#nameSlider"
).data(
"kendoSlider"
);
var
sliderItems = selectedSlider.siblings(
".k-slider-items"
);
$.each(steps,
function
(index, value) {
var
item = sliderItems.find(
"li:eq("
+ (index) +
")"
);
item.attr(
"title"
, value);
item.find(
"span"
).text(value);
});
});
</script>
unfortunately, it does not work.
Any ideas?