Radio and data-change : event not triggered

5 posts, 1 answers
  1. Chris @ Willows Consulting Ltd.
    Chris @ Willows Consulting Ltd. avatar
    15 posts
    Member since:
    Sep 2013

    Posted 16 Oct 2013 Link to this post

    Hi guys,

    My code is live here:
    http://www.semiconductorconnect.org/kendo/#categorylist

    I want to use data-change along with a radio button, but the JS function is not triggered, see the abbreviated code below:
    <div id="categorylist" data-role="view" data-title="Category List" data-layout="checklayout">
        <ul data-role="listview" data-style="inset" data-type="group">
            <li>
                Category List
                <ul>
                                    <li>
                        <label>
                            <input name="categorylistradio" type="radio"  value="1" data-change="categoryswitch" />
                            <div style="height: 8px; width:8px; background: #67e667; border:1px; border-style:solid; float:left; margin-right: 3px; margin-top: 7px;"></div>Academic                    </label>
                    </li>
                                </ul>
            </li>
        </ul>
    </div>
    <script>
        function categoryswitch(e) {
            alert('test');
        }
        kendo.init($("#categorylist"));
    </script>

    Regards
  2. Chris @ Willows Consulting Ltd.
    Chris @ Willows Consulting Ltd. avatar
    15 posts
    Member since:
    Sep 2013

    Posted 16 Oct 2013 Link to this post

    Do I have to use the usual JS event method "onClick" ?... I have tested it and it's working, but I don't know if this is KendoMobileUI compliant?
  3. Kendo UI is VS 2017 Ready
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 17 Oct 2013 Link to this post

    Hi Sean,

    Using data attributes for handling user events is valid only for Kendo UI widgets. You can not use Kendo UI specific data attributes for standard HTML elements.

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Chris @ Willows Consulting Ltd.
    Chris @ Willows Consulting Ltd. avatar
    15 posts
    Member since:
    Sep 2013

    Posted 17 Oct 2013 Link to this post

    Hello Kiril,

    Thanks for the follow-up.
    So "onClick" is the way to go?
  6. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 21 Oct 2013 Link to this post

    Hi Sean,

    Any event handler (include jQuery .on()), should do the trick in your case. If you prefer onClick, it should be good enough.
     

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready