Click event on listview or listview item without data binding

5 posts, 0 answers
  1. Bruce
    Bruce avatar
    6 posts
    Member since:
    Jul 2012

    Posted 18 Oct 2013 Link to this post

    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 
  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 21 Oct 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Bruce
    Bruce avatar
    6 posts
    Member since:
    Jul 2012

    Posted 22 Oct 2013 Link to this post

    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?
  5. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 23 Oct 2013 Link to this post

    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!
  6. Bruce
    Bruce avatar
    6 posts
    Member since:
    Jul 2012

    Posted 23 Oct 2013 Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready