尝试如下
jqGrid({
datatype: 'json',
colNames: ["<input type='checkbox' name = 'chkAllOutputField'/>", "other columns" ]
Run Code Online (Sandbox Code Playgroud)
复选框显示在标题上,但无论您如何点击它都不会被选中/取消选中.
如何通过单击选中/取消选中它
在这里找到一种方法:如何在jQgrid标头中添加一个复选框
<input type="checkbox" onclick="checkBox(event)" />
Run Code Online (Sandbox Code Playgroud)
并添加了以下方法......
function checkBox(e)
{
e = e||event;/* get IE event ( not passed ) */
e.stopPropagation? e.stopPropagation() : e.cancelBubble = true;
}
Run Code Online (Sandbox Code Playgroud)