Select a Kendo control generated by helper

2 posts, 1 answers
  1. stephane
    stephane avatar
    10 posts
    Member since:
    Jan 2010

    Posted 16 Jun 2014 Link to this post

    When I generate a kendo control  thanks to Jquery, it is easy to select and put it in a javscript var  for doing stuffs on it
    @section scripts
            $(document).ready(function () {
                  var slider = jQuery("#slider").kendoSlider({
                    increaseButtonTitle: "Right",
                    decreaseButtonTitle: "Left",
                    showButtons: true,
                    min: 1,
                    max: 4,
                    largeStep: 1,
                    tooltip: {
                        enabled: false
    <input id="slider" class="sliderClass" />
    I would like to be able to select the same kendo control generated by the helper way, and put it  in javascript var but i can't manage to do it . Any ideas??????
    @section scripts
           var slider = $(".balSlider").kendoSlider; //want to select the kendo control and put it in a  var  but FAIL!!!
                               .Events(events => events
                      .HtmlAttributes(new { @class = "balSlider" })
  2. Answer
    Sebastian avatar
    9934 posts

    Posted 16 Jun 2014 Link to this post

    Hello Stephane,

    As this article outlines, you need to use the jQuery's data method to reference the client object of Kendo UI widgets.

    Also note that the script tag should be placed after the widget's MVC initialization code to ensure it has been instantiated when you reference it in javascript. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top