paul
paul

Reputation: 1124

How to select all rows on a button click in jqGrid?

I can I select all rows on button click ...lets say I have a button call Select All ..When I click on that button it needs to select all rows ....I did n't find any relevant documentation on JqGrid API ....

Any help will be appreciated.

Thanks!

Upvotes: 0

Views: 10389

Answers (2)

JimmyB
JimmyB

Reputation: 91

I use the following Code

jQuery("#toolbar").jqGrid('navButtonAdd','#toolbar_toppager',{caption:"Select All", onClickButton:function(){ 
         if($('.cbox').is(":checked")){ jQuery("#toolbar").jqGrid('resetSelection'); }else{$('.cbox').trigger('click').attr('checked', true);}
      } });

This seems to fix the issue with having to double click on the check boxes

Upvotes: 0

Oleg
Oleg

Reputation: 221997

It seems to me that this example which I described in How to invoke the reset selection and select all in jqGrid? do what asked.

Upvotes: 4

Related Questions