Search code examples
jqgrid-formatter

Jq Grid - Show/Hide all Grid


I have four jqgrid in my jsp application. They are loaded via ajax using the method addXmlData (messageXML) How can I hide three of the grid and show only one of them, and in accordance with the click of a button, hide and show the other grids. The content of the grids are updated according to the user's needs via ajax. I need only show one at a time not to mess up the form.


Solution

  • I found the solution. Pretty simple to tell the truth. just add the tags table between divs and use the $ ("# divid"). hide (); to hide and $ ("# divid"). show (); to display.

    The code was as follows.

    ...
    
        <div id="divid">
            <table id="listid" class="scroll"> <tr> <td/> </ tr> </ table>
        </ div>
    
    ...
    
    <script>
    ...
        $ ("#divid"). hide ();
        $ ("#divid"). show ();
    ...
    </ script>