title: Is it possible to modify the colModel after data has loaded with jqgrid?
body: <p>I've got a jqGrid where I need to change the model after the data is loaded, but before it's parsed into the grid. In otherwords, I think I want to do it in the loadComplete handler. I see this approach: <a href="https://stackoverflow.com/questions/3308856/setting-jqgrids-colname-and-colmodel-from-json-data">Setting JqGrid&#39;s colName and colModel from JSON data</a>, but I'm have a bunch of grids already written that use the "load data with jqGrid" approach, rather than the "pre-load data and pass it to jqGrid" one used there, and I'm hoping to avoid re-coding, or making this one different.</p>
  
  <p>(Hiding and showing hidden columns isn't practical, either.)</p>
  
  <p>Is this possible? </p>
  
  <p>More details:</p>
  
  <p>Basically, I don't know what columns I need till I see the data. Say I'm showing traffic by state:</p>
  
  <pre><code>Date      CA     WA     NY    MN
  4/20      100    90     85    72
  4/21       95    85     89    70
  </code></pre>
  
  <p>There's only room to show four states, but there might be many more in the data (or there might be fewer), so I want them listed in order of traffic. Right now, the data is coming in like:</p>
  
  <pre><code>{
  date : 4-20,
  ca : 100,
  wa : 90,
  ny : 85,
  mn : 72
  hi : 56,
  il : 30
  },
  {
  date : 4-21,
  ca : 95,
  wa : 85, // note: for a given row, a column might be relatively lower
  ny : 89, // than another. The column order is based on the overall
  mn : 70
  hi : 60,
  il : 45
  }
  </code></pre>
  
  <p>or it could be:</p>
  
  <pre><code>{
  date : 4-20,
  ny : 110,
  hi : 95,
  il : 90,
  wa : 80
  }
  </code></pre>
  
  <p>I've tried setting up columns like state1, state2, state3, state4 and then using jsonmap to remap them, but it didn't work.</p>
  
  <p>loadonce = true, datatype = json</p>