Multiple select locations on mobilelistview

4 posts, 1 answers
  1. Kelly
    Kelly avatar
    28 posts
    Member since:
    Oct 2012

    Posted 06 Aug 2013 Link to this post

    I have a mobile list view where I need to allow a user to select an item and/or decide if that item should be added to a favorites list. I can have the user select the item just find but I'm not sure how to allow them to add that item to their favorites. I have an image on one side of the list that the user should click on to add the favorite. How do I determine what part of the item the user clicked. I know it should be something like

    click: function (e) {
         e.target ?
    }
    but I'm not sure how to use the target property. I tried using e.target.id but that didn't work and I haven't found any documentation at this point.
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 07 Aug 2013 Link to this post

    Hi,

    If the clickable item in question is a button, you can check for it in the e.button field.

    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. Kelly
    Kelly avatar
    28 posts
    Member since:
    Oct 2012

    Posted 07 Aug 2013 Link to this post

    Currently it's just an image. I tried changing it to a button but I think there's a problem with the fact that I'm changing the button image dynamically. I need to be able to swap out the image if the user toggles the favorite off or on. The img tag does have an id but e.target.id returns undefined and selects the whole item. Is it possible to run the following psuedo code in a mobile list view?

    if (image clicked)
        do this
    else if (rest of list clicked)
        do this
  5. Answer
    Kelly
    Kelly avatar
    28 posts
    Member since:
    Oct 2012

    Posted 07 Aug 2013 Link to this post

    I've found I can use the attr property to grab what I need. eg: e.target.attr('id').
Back to Top
Kendo UI is VS 2017 Ready