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

How to implement a single selection for a list view with a check box?

1 Answer 45 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
DINHDUY
Top achievements
Rank 1
DINHDUY asked on 02 Aug 2013, 02:56 PM
I have the following  markup:

<ul id="answers" data-role="listview" data-style="inset" data-template="answer-template" data-bind="source: availableAnswers" data-click="app.views.question.selectAnswer" ></ul>

     <script id="answer-template" type="text/x-kendo-template">
            <label>
                <input type="checkbox" data-bind="checked: isSelected"/>
                <span data-bind="text: answerText"></span>
            </label>
        </script>

The following click handler does work in Chrome Browser, however it does not work on any mobile device:
selectAnswer: function (evt) {
$.each(that.availableAnswers, function (i, it) {
                it.isSelected = (it.id === evt.dataItem.id);
            });
}

Is there an option on the list view to set it to  single selection mode?

Thanks,
Dinhduy

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 05 Aug 2013, 08:11 AM
Hi,

Instead of using checkboxes, you can use radio buttons. They look the same on a mobile platform, and support such selection out of the box. Please check this demo for more details.

Regards,
Petyo
Telerik
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
DINHDUY
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or