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

how to distince between checkbox selection to list item clicked?

1 Answer 72 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Doron
Top achievements
Rank 1
Doron asked on 02 Jan 2013, 01:31 PM
I have KendoMobileListView. In the template I also have a check-box. when user click on an item of the list there is a click event being fired. I would like to ignore the click event when user select/unselect the check-box.

please help

Hagai

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 03 Jan 2013, 03:58 PM
Hello Sahar,

I am afraid that what you would like to achieve is not supported. In the current implementation the state of check boxes is toggled on click of the whole ListView item. You can test the behaviour here. This is done for usability - standard check box is too small and it might be difficult for the user to click on it with finger.

As an alternative approach I suggest using switch widget instead of check box.

To distinguish the click event of the switch from the one of the ListView you can check if the e.target is part of the switch e.g. if it have parent with class km-switch.
function onClick(e) {
    var isSwitch = e.target.parents(".km-switch").length;
    if(!isSwitch) {
        //do something
    }
}

You can test the solution here.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Doron
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or