How to data-bind touch events

2 posts, 0 answers
  1. Robert
    Robert avatar
    39 posts
    Member since:
    Oct 2012

    Posted 16 Jul 2013 Link to this post

    A touch event can be handle by:

    <img id="login-badge" src="..." data-role="touch" data-hold="didTapHold"/>

    How can do use binding to connect this to a object's method?  Something akin to the following:

    <img id="login-badge" src="..." data-role="touch" data-bind="???: viewModelDidTapHold"/>

    Thanks.
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2892 posts

    Posted 17 Jul 2013 Link to this post

    Hi Robert,

    Please use the events binding. As an example:
    <div data-role="touch" data-bind="events: { hold: didTabHold }"></div>
     
    var viewModel = kendo.observable({
        didTabHold: function(e) {
            console.log(e);
        }
    });
    kendo.bind($(document.body), viewModel);


    Regards,
    Alexander Valchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top