简体   繁体   English

在Kendo UI中处理单选

[英]Handling radio click in kendo ui

I am new with kendo UI and javascript. 我是Kendo UI和javascript的新手。

Actually, I am using Kendo UI in my new phonegap application. 实际上,我在新的phonegap应用程序中使用Kendo UI。 I want to show/hide particular control on radio change event. 我想显示/隐藏有关无线电更改事件的特定控件。 Below is my code 下面是我的代码

 $(document).ready(function(){

                          $('.block1').hide();
                          $('#thankYouMsgChild').hide();
                          $('#yesResultChild').hide();
                          $('#noMultiResponse').hide();
                          $('#yesMultiResponse').hide();
                          $('#surveyPageChild').hide();
                          $('#yesResponseCnt').hide();
                          $('#yesPassword').hide();
                          $('#yesIPBlocking').hide();
                          $('#addCutOffTime').hide();
                          });


        $("input[type='radio']").on("change",function(){
                                    alert("Change Call");
                                    if(this.id=="eliminatePage" || this.id=="eliminateMsg"){
                                        $('.block1').hide();
                                        $("#"+this.value+"").show();
                                    }
                                    else if(this.id=="yesThanks"){
                                        $("#thankYouMsgChild").show();
                                    }
                                    else if(this.id=="noThanks"){
                                        $("#thankYouMsgChild").hide();
                                    }
                                    else if(this.id=="yesResult"){
                                        $("#yesResultChild").show();
                                    }
                                    else if(this.id=="noResult"){
                                        $("#yesResultChild").hide();
                                    }
                                    else if(this.id=="yesMultiResp"){
                                        $("#noMultiResponse").hide();
                                        $("#yesMultiResponse").show();
                                    }
                                    else if(this.id=="noMultiResp"){
                                        $("#noMultiResponse").show();
                                        $("#yesMultiResponse").hide();
                                    }
                                    else if(this.id=="surveyPage"){
                                        $("#surveyPageChild").show();
                                    }
                                    else if(this.id=="yesResponse"){
                                        $("#yesResponseCnt").show();
                                    }
                                    else if(this.id=="noResponse"){
                                        $("#yesResponseCnt").hide();
                                    }
                                    else if(this.id=="yesPwd"){
                                        $("#yesPassword").show();
                                    }
                                    else if(this.id=="noPwd"){
                                        $("#yesPassword").hide();
                                    }
                                    else if(this.id=="yesIP"){
                                        $("#yesIPBlocking").show();
                                    }
                                    else if(this.id=="noIP"){
                                        $("#yesIPBlocking").hide();
                                    }
                                    else if(this.id=="yesTime"){
                                    $("#addCutOffTime").show();
                                    }
                                    else if(this.id=="noTime"){
                                    $("#addCutOffTime").hide();
                                    }
                                    });

But radio change event is not called. 但是没有广播变更事件。 So please anybody can look over this and let me know what's the actual problem is. 因此,请任何人都可以仔细研究一下,并让我知道实际的问题是什么。

Thanks in advance 提前致谢

I think problem not in Kendo UI and not in JavaScript code, guess need check html markup of your page. 我认为问题不在Kendo UI和JavaScript代码中,我想需要检查页面的html标记。 I made test page, http://jsfiddle.net/dnisterlark/VqHEV/ , all works perfect. 我制作了测试页, http://jsfiddle.net/dnisterlark/VqHEV/ ,都可以完美运行。

[ignore this - just including a code block so stackoverflow will
let me post the above JSFiddle link.  Yeah, seriously.]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM