您好,可以参照- // create checkboxes to toggle column visibility
- var columns = grid.wijgrid("option", "columns");
- var listContainer = $("#checkboxes");
- $.each(columns, function (index, col) {
- var isChecked = col.visible ? "checked = 'checked'" : "";
- var 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");
- })
- })
- });
复制代码 |