How to set jqGrid as default for camber

I have a jqgrid worksheet, and I wanted the default table to collapse upon loading. I checked the documentation on the site, but could not find this option. The button has a class ui-icon-circle-triangle-n.

many thanks.

+5
source share
3 answers

I once did this by calling .click () on the minimize button after loading the table. This may not be the most reliable solution, but it worked for me.

+3
source

hiddengrid is a grid property that accomplishes what you want. See the last set of properties in the example below.

<script type="text/javascript">
     jQuery(document).ready(function () {
         var grid1 = jQuery("#list1").jqGrid({
             url: '/controller/action/',
             datatype: 'json',
             mtype: 'POST',
             colNames: ['Col1', 'Col2'],
             colModel: [
      { name: 'Col1', index: 'Col1', width: 22, align: 'left'},
      { name: 'Col2', index: 'Col2', width: 22, align: 'left'}
      ],
             sortname: 'Col1',
             sortorder: "asc",
             caption: 'Sample Grid',
             rowNum: 10,
             pager: '#,
             hiddengrid: true

     });
</script> 
+9
source

, .

groupingView groupCollapse gridOptions.

:

// grid options
{
   groupingView: {
       //Collapse all
       groupCollapse: true
   }
}
+1

All Articles