This is a migrated thread and some comments may be shown as answers.

How to data-bind touch events

1 Answer 170 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 16 Jul 2013, 11:18 PM
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.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 17 Jul 2013, 12:30 PM
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!
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or