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

Radio and data-change : event not triggered

4 Answers 585 Views
Application
This is a migrated thread and some comments may be shown as answers.
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
Chris @ Willows Consulting Ltd. asked on 16 Oct 2013, 10:55 AM
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

4 Answers, 1 is accepted

Sort by
0
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
answered on 16 Oct 2013, 11:39 AM
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?
0
Kiril Nikolov
Telerik team
answered on 17 Oct 2013, 09:42 AM
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!
0
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
answered on 17 Oct 2013, 12:29 PM
Hello Kiril,

Thanks for the follow-up.
So "onClick" is the way to go?
0
Accepted
Kiril Nikolov
Telerik team
answered on 21 Oct 2013, 07:17 AM
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!
Tags
Application
Asked by
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
Answers by
Chris @ Willows Consulting Ltd.
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or