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

Multiple select locations on mobilelistview

3 Answers 54 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 06 Aug 2013, 09:11 PM
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.

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 07 Aug 2013, 11:08 AM
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!
0
Kelly
Top achievements
Rank 1
answered on 07 Aug 2013, 12:03 PM
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
0
Accepted
Kelly
Top achievements
Rank 1
answered on 07 Aug 2013, 06:57 PM
I've found I can use the attr property to grab what I need. eg: e.target.attr('id').
Tags
ListView (Mobile)
Asked by
Kelly
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Kelly
Top achievements
Rank 1
Share this question
or