jqGrid에서 celledit 사용시 multiselect 사용이 안되는 현상 해결방법.
페이지 정보
작성자 최고관리자 댓글 0건 조회 281회 작성일 19-01-27 12:02본문
옵션중 "multiselect:true"는 "cellEdit:true"와 동시 사용이 불가하다.
[code]
height: 390,
multiselect: true,
cellEdit: true,
cellsubmit: 'clientArray',
autowidth:true,
[/code]
위처럼 작성이 되면 자료를 선택하는 체크박스를 체크하여도 오류가 발생되어 제대로 체크가 안되거나 다른 자료의 체크박스가 표시되는 현상이 발생된다.
이를 해결하기 위해 아래의 코드를 사용하면 해결된다.
[code]
beforeSelectRow: function (rowid, e) {
var $self = $(this), iCol, cm,
$td = $(e.target).closest("tr.jqgrow>td"),
$tr = $td.closest("tr.jqgrow"),
p = $self.jqGrid("getGridParam");
if ($(e.target).is("input[type=checkbox]") && $td.length > 0) {
iCol = $.jgrid.getCellIndex($td[0]);
cm = p.colModel[iCol];
if (cm != null && cm.name === "cb") {
// multiselect checkbox is clicked
$self.jqGrid("setSelection", $tr.attr("id"), true ,e);
}
}
return false;
}
[/code]
댓글목록
등록된 댓글이 없습니다.