kendo-ui - 在 Web 应用程序中使用 Kendo UI 开关

标签 kendo-ui kendo-mobile

我正在尝试使用 Kendo 移动小部件 - 在我的 Web 应用程序中切换,如下所示:

enter image description here

<input id="btnConvert" type="checkbox" onclick="onChange();" />

 $(document).ready()
    {        
        $("#btnConvert").kendoMobileSwitch({
            onLabel: "UK",
            offLabel: "US"
        });        
    }
    function onChange(e) {
        alert(e.checked);//true of false
    }

但它没有触发点击事件。我尝试了 onchange 事件,但也不起作用。

我也尝试过

    $('input:checkbox').change(function () {
}

但没有成功...

最佳答案

switch 定义中定义 change 处理程序事件。

$("#btnConvert").kendoMobileSwitch({
    onLabel: "UK",
    offLabel: "US",
    change : function (e) {
        alert("You changed the value");
    }
}); 

请参阅文档 here .

关于kendo-ui - 在 Web 应用程序中使用 Kendo UI 开关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24999809/

相关文章:

javascript - 在 Javascript 或 HTML5 中禁用 Kendo Mobile Switch

html - 元名称 ="viewport"内容 ="width=device-width"不适用于 Kendo UI Mobile

javascript - 剑道网格 : Can we run example with Angular using jsfiddle?

javascript - 剑道按钮数据单击剑道网格模板内不起作用

javascript - 使用 Kendo Mobile,如何防止 View 滚动?

javascript - 如何将 Kendo AutoComplete 值设置为 ""

css - 覆盖 Icenium 中的默认 kendo-ui 样式

ruby-on-rails - Rails 4.2 强参数和解析 json put/update 上更改的属性

angular - 在 kendo-daterange 上设置日期范围限制

javascript - 模板内的按钮从不调用处理程序