我正在尝试使用 Kendo 移动小部件 - 在我的 Web 应用程序中切换,如下所示:
<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/