我正在尝试使用jqxgrid中的复选框打印jqxgrid下拉列表值我已经绑定了jqxgrid列中jqxdropdownlist中的值但是当我尝试使用checkChange事件绑定vaules时问题是检查值是打印但同时事件多次触发我想一次打印一个值,所以请建议我如何做这个
我试过这段代码
{
text: 'Sort Type', columntype: 'dropdownlist', datafield: 'aliasname1', width: '11%', editable: true,
createeditor: function (row, cellvalue, editor, celltext, width, height) {
// construct the editor. var requiredfield =
var requiredfield =
[
"Ascending", "Descending", "Unsorted"
];
editor.jqxDropDownList({
checkboxes: true, source: requiredfield, autoDropDownHeight: true, selectedIndex: -1
});
$(document).on('checkChange', function (event) {
var checked = event.args.checked;
var colvalue = $('#shipmentgrid').jqxGrid('getcellvalue', row, 'column');
var tblvalue = $('#shipmentgrid').jqxGrid('getcellvalue', row, 'table');
if (checked == true) {
var textareavalue = $("#txtQueryList").val();
var sortvalues = textareavalue.split('ORDER BY ');
var aa = sortvalues[1];
if (aa != undefined) {
var bb = aa.split(',');
for (i = 0; i < bb.length; i++) {
if (bb[i] != "") {
try {
var s = bb[i];
var t = s;
if (colvalue == t) {
}
else {
var ee = textareavalue + "," + colvalue;
$('#txtQueryList').empty();
$("#txtQueryList").append(ee);
}
}
catch (ex) {
}
}
}
}
else {
$("#txtQueryList").append("\n", "\n", "\n", "ORDER BY", " ", colvalue);
}
}
else {
}
});
}
}
答案 0 :(得分:1)
添加&#39; checkChanged&#39;编辑器对象的事件处理程序,而不是文档
editor.on('checkChange', function (event) {