0

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!

paul
  • 1,124
  • 9
  • 27
  • 45
  • Why you don't use http://www.ok-soft-gmbh.com/jqGrid/DataToMultiSelect1.htm which I described in http://stackoverflow.com/questions/3571324/how-to-invoke-the-reset-selection-and-select-all-in-jqgrid/3577559#3577559? – Oleg Aug 27 '10 at 15:46
  • 1
    Are you the same Paul like http://stackoverflow.com/users/424687/paul? – Oleg Aug 27 '10 at 15:49
  • Thanks! Its working ..nopes I am not – paul Aug 27 '10 at 17:39
  • 1
    You welcome! I am glad to hear, that I could helps two Paul! – Oleg Aug 27 '10 at 18:20
  • Oleg how can I vote for this answer...this is really a simple and nice code.. – paul Aug 27 '10 at 18:29
  • Thank you for advice! I filled the information from the comment in the answer below. – Oleg Aug 27 '10 at 21:09

2 Answers2

4

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.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
0

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

JimmyB
  • 101
  • 6