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

Click event on listview or listview item without data binding

4 Answers 398 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 18 Oct 2013, 07:11 PM
I'm not using data binding in my app, but want to be able to know when a user taps on an item in the listview and have it call a function.

Is this possible?  If it isn't, I'm willing to do unnatural things to make it possible.  Where should I look in the code?

Sure, I could just use jquery to add an event but that doesn't work well with the special "tap" and "tap-end" events you have in there.  So, to be more specific I want to be able to know when a user tapped using your built in Touch event support so that I don't have to wait 300ms for the click event to fire off.

thanks,

-Bruce 

4 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 21 Oct 2013, 11:09 AM
Hi Bruce,

You can take advantage of the tap event of touch component.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bruce
Top achievements
Rank 1
answered on 22 Oct 2013, 07:47 PM
That's perfect, however no matter what I try I can't add the tap event to the <ul> or to the <li> items within them.  Can you?
0
Petyo
Telerik team
answered on 23 Oct 2013, 11:18 AM
Hello Bruce,

In case you want to handle the click on the listview element level, the click event binding works with unbound listview, too.  

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Bruce
Top achievements
Rank 1
answered on 24 Oct 2013, 12:06 AM
That worked!  I just want to confirm that using this method in a mobile browser will get around the 250 MS click delay, the same as if I had used the kendo touch events.

The whole point of this is to get one of my own functions to execute on click of the listview WITHOUT having the delay that browsers on mobile devices natively add to a normal click event.
Tags
ListView (Mobile)
Asked by
Bruce
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Bruce
Top achievements
Rank 1
Share this question
or