我目前有一个 wijmo 网格,在绑定完成后会出现一个带有复选框的列列表。我想将复选框添加到弹出窗口中,以便仅在单击时可见。以下代码是我必须隐藏和取消隐藏选中和未选中条件的列。
self.hideCols = function () {
var columns = $('#Grid').wijgrid("option", "columns"),
listContainer = $("#columnsList"),
checkBox, isChecked;
$.each(columns, function (index, col) {
isChecked = (col.visible)
? "checked = 'checked'"
: "";
checkBox = $("<label><input type='checkbox' " + isChecked + " />" + col.headerText + "</label>");
listContainer.append(checkBox);
checkBox.click(function (e) {
columns[index].visible = $(this).children("input")[0].checked;
$('#Grid').wijgrid("doRefresh");
})