jqGrid multiselect “check all” in header: how to hide it?

前端 未结 3 489
攒了一身酷
攒了一身酷 2020-12-02 00:02

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) s

相关标签:
3条回答
  • 2020-12-02 00:24

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

    0 讨论(0)
  • 2020-12-02 00:26

    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();
    
    0 讨论(0)
  • 2020-12-02 00:30

    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'); 
    }
    
    0 讨论(0)
提交回复
热议问题