12

I use jqGrid with the multiselect option set to true.

I'm looking for a way to hide or disable the first checkbox (the one in the row of the column names) so that users can't use the "check all/uncheck all" feature.

How to do it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
alessiodl
  • 121
  • 1
  • 1
  • 3

3 Answers3

25

The checkbox in the header has the id which is combined from the "cb_" prefix and the grid id. So you can hide the element with

var myGrid = $("#list");
$("#cb_"+myGrid[0].id).hide();
Oleg
  • 220,925
  • 34
  • 403
  • 798
0

Find the div of checkbox and hide/overwrite its inner HTML.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
MLS
  • 885
  • 1
  • 9
  • 16
0

If you have runat parameter

<trirand:JQGrid ID="grdTest" runat="server" 
"MultiSelect="true" MultiSelectMode="SelectOnRowClick">
    <Columns>
    <!-- cols -->
    </Columns>

     <ClientSideEvents GridInitialized="GrdInit" /><!-- add this -->
    </trirand:JQGrid>

On your page:

function getCont(control)
{
    if(control == "grdTest")
    { 
       return $("#<%= grdTest.ClientID %>"); 
    }
}

Then in your js file:

function GrdInit() 
{ 
    var myGrid = getCont("grdTest"); 
    myGrid.jqGrid('hideCol', 'cb'); 
}
steveax
  • 17,527
  • 6
  • 44
  • 59
Mio
  • 11
  • 2