title: jqgrid: How to format master/detail grids?
body: <p>I have a jqgrid with a subgrid.</p>
  
  <p>I am attempting to apply different colors to master and detail grids. I have two rules: the first one is to alternate odd and pair colors and the other one is to apply specific CSS to the row, based on values of a specific field.</p>
  
  <p>Both master &amp; details grid, contains the following gridComplete functions, where obviously childnodes index varies cause tables contains different fields:</p>
  
  <pre><code>gridComplete: function () {
              var _rows = $(".jqgrow");
              for (var i = 0; i &lt; _rows.length; i++) {
                  _rows[i].attributes["class"].value += " " + _rows[i].childNodes[4].textContent;
                  _rows[i].attributes["class"].value += " " + _rows[i].childNodes[4].innerText;
              }
             applyZebra("jqTicketgrid");
          }
  </code></pre>
  
  <p>applyZebra function provides to alternate odd/pair colours and has already been tested on another grid which not contains a subgrid.
  For the record, I found above solutions in other solved questions of this forum, and both works with "simple" jqgrids (not master/detail).</p>
  
  <p><strong>PROBLEM</strong>
  The master grid is formatted only when I click to expand the detail rows, while detail subgrid never alternate colours, neither apply format based on cell contents...</p>
  
  <p>Where I am wrong? Pheraps I must intercept another event which is not gridComplete? Otherwise with grid&amp;subgrids it's impossible to use _rows[x] &amp; childNodes[y] attributes?</p>
  
  <p>Please ask for clarifications, if needed, thx.</p>
  
  <p>Thanks in advance!</p>