0
我有一个显示问卷的Kendo网格。问题ID和问题是使用AJAX调用从数据库中提取的。我在运行时将单选按钮添加到网格中。Kendo UI网格单选按钮更改事件不发射?
我的问题是单选按钮没有触发更改的事件。我的代码如下:
<div style="height: 950px;" id="grdQuestions"></div>
<div style="text-align: center; margin-top: 10px;">
<button class="k-button" id="submitresults" type="submit">Submit Results</button>
</div>
<script>
$(document).ready(function() {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
type: "GET",
url: "/AjaxHandler.aspx?requesttype=getquestions",
dataType: "json",
contentType: "application/json; chartset=utf-8"
}
},
pageSize: 25
});
$("#grdQuestions").kendoGrid({
dataSource: dataSource,
pageable: {
pageSizes: true
},
columns: [
{
field: "QuestionsId",
title: "Question Id",
width:90
},
{
field: "QuestionText",
title: "Question",
width:700
},
{
title: "Not me at all",
template: "<input class='radioq' type='radio' name=" + "'" + "select" + '#: QuestionsId #' + "'" + "id=" + "'" + "notme" + '#: QuestionsId #' + "'" + "/>",
},
{
title: "This is true some of the time",
template: "<input class='radioq' type='radio' name=" + "'" + "select" + '#: QuestionsId #' + "'" + "id=" + "'" + "strue" + '#: QuestionsId #' + "'" + "/>"
},
{
title: "This is true most of the time",
template: "<input class='radioq' type='radio' name=" + "'" + "select" + '#: QuestionsId #' + "'" + "id=" + "'" + "mtrue" + '#: QuestionsId #' + "'" + "/>"
},
{
title: "This is me",
template: "<input class='radioq' type='radio' name=" + "'" + "select" + '#: QuestionsId #' + "'" + "id=" + "'" + "itsme" + '#: QuestionsId #' + "'" + "/>"
}]
});
$("input[type='radio']").on("change", function() {
alert(this.value);
});
});
</script>
@sony没有问题兄弟:) –
欢迎大..... – sony