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

2 posts, 0 answers
  1. DINHDUY
    DINHDUY avatar
    1 posts
    Member since:
    Jun 2013

    Posted 02 Aug 2013 Link to this post

    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

  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 05 Aug 2013 Link to this post

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