我现在有一个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");
})发布于 2015-06-24 15:21:08
这样啊,原来是这么回事。只需使用HTML创建一个弹出,并在<div id="dialog" data-bind="wijdialog: {disabled: disabled, autoOpen: autoOpen, draggable: draggable, modal: modal, resizable: resizable }" title="Uncheck to Hide Columns"> <table id="columnsList"></table> </div>中包含列列表
https://stackoverflow.com/questions/30987381
复制相似问题