event handling

2 posts, 0 answers
  1. Kirill
    Kirill avatar
    4 posts
    Member since:
    Sep 2011

    Posted 01 Oct 2011 Link to this post

    HI again.
    I have some element above the slider, so clicking or tapping on it doesn't cause slider working. How can I transmit click on my element to slider? I need do transmit X-coordinate. Relative X-coordinate will be the same because slider and element wich is luing above are children of the same parent. Anyway I can set some offset - I just need to know how can I transmit event and click x-coordinate. Has kendo some built-in methods?
  2. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 03 Oct 2011 Link to this post

    Hi Kirill,

    Thank you for contacting us.

    Unfortunately there are no build-in methods.

    You can try this workaround:

    $("#yourElement").click(function(e) {
        var slider = $("#slider").data("kendoSlider"),
            dragableArea = slider._getDragableArea(),
            location = kendo.touchLocation(e),
            mousePosition = slider._isHorizontal ? location.x : location.y,
            valueFromPosition = slider._getValueFromPosition(mousePosition, dragableArea);
     
        slider.value(valueFromPosition);
    });

    If this workaround is not working for you could you please provide more information about your scenario, thus I will be able to help you.

    Kind regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top