title: jqgrid - dynamically enabling grouping
body: <p>I was able to implement grouping feature from examples in the jqgrid demo page. But I don't want to enable grouping by default but on the change of a select list I would like to enable the grouping feature. I have tried several options but none of them were successful? Could some one please help me here, may be I am missing something. Here is my code...</p>
  
  <pre><code>$("#dynamicGrouping").change(function() { 
      var value = $(this).val(); 
      if(value) { 
          if(value == '') { 
              $('#grid').jqGrid('groupingRemove', true); 
          } else { 
              $('#grid').jqGrid('setGridParam', { grouping:true });
              $('#grid').jqGrid('groupingGroupBy', value);
              $('#grid').trigger('reloadGrid');
          } 
      }
  });
  </code></pre>
  
  <p>My grid definition:</p>
  
  <pre><code>jQuery(function() {
      $('#grid').jqGrid({
              .....
              .....
          grouping: false,
          groupingView : { 
                  groupField : ['field_name'], 
              groupColumnShow : [true], 
              groupText : ['&lt;b&gt;{0} - {1} Item(s)&lt;/b&gt;'], 
              groupCollapse : false, 
              groupOrder: ['asc'], 
              groupDataSorted : true 
              },
          .......
          .......
      });
  });
  </code></pre>