0

How can I check all rows of jQWidgets jqxGrid with checkbox options programmatically‎? I can loop through rows and select them one-by-one or use

$("#jqxgrid").jqxGrid('selectallrows');

but I need to make a selection via the checkbox option - see

http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm?%28arctic%29#demos/jqxgrid/checkboxselection.htm

Basically I need to replicate a click on the top "Select All" checkbox.

How can I do this?

Thanks!

4

3 回答 3

2

这是解决方案:

$('#jqxGrid').jqxGrid({ selectionmode: 'checkbox'}); 

这将在复选框的开头添加一个新列,并为“checkall”操作添加一个框。

于 2013-11-19T04:04:38.443 回答
0

解决方案是:

$('#jqxGrid').jqxGrid('selectallrows');
于 2013-09-10T09:27:47.903 回答
0

这个怎么样?

var rows = $('#grid').jqxGrid('getRows');
for(var i = 0 ; i < rows.length ; i++){
    var _item = rows[i];
    $('#grid').jqxGrid('setcellvaluebyid', _item.boundindex, "[YOUR COLUMN]", true);
}//for end(i)
于 2022-01-17T02:13:01.037 回答