title: jqGrid TreeGrid with checkboxes, check in parent, mark all child checkboxes
body: <p>I have a TreeGrid with checkboxes in both parent and child nodes. 
  Checking a checkbox in parent node should mark all checkboxes in child nodes.
  My TreeGrid works ok, I tried to bind an event only to parent node in a custom formatter. It also worked. Later on I tried to mark child nodes but with no effect. Child nodes' checkboxes remain unchanged. Please help! </p>
  
  <pre><code>    $(document).ready(function () {
  
      jQuery("#list2").jqGrid({
          url: '@Url.Action(some action it is ok)
          mtype: 'GET',
          ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
          datatype: "json",
          colNames: ['id', 'Data', 'Typ', 'Liczba dni', 'Liczba    godzin', 'Zatwierdzalny', 'Anulowalny', 'Zatwierdz', 'Anuluj'],
          colModel: [
                         { name: 'id', index: 'id', hidden: true },
                         { name: 'data', index: 'data' },
                         { name: 'typ', index: 'typ' },
                         { name: 'ileDni', index: 'ileDni' },
                         { name: 'ileGodzin', index: 'ileGodzin' },
                         { name: 'zatwierdzalny', index: 'zatwierdzalny'},
                         { name: 'anulowalny', index: 'anulowalny', hidden: true },
      //                           { name: 'zatwierdz', index: 'zatwierdz',
      //                               editable: true, edittype: 'checkbox',editoptions: { value: "True:False" },
      //                               formatter: "checkbox", formatoptions: { disabled: false }
      //                           },
                         { name: 'zatwierdz', index: 'zatwierdz', edittype: 'checkbox', editoptions: { value: "True:False" },
                           editable: true, formatter: cboxFormatter, unformat: cboxUnFormatter
                         },
                         { name: 'anuluj', index: 'anuluj',
                             editable: true, edittype: 'checkbox', editoptions: { value: "True:False" },
                             formatter: "checkbox", formatoptions: { disabled: false }
                         }
                    ],
          rowNum: 50,
          height: 'auto',
          records: 50,
          width: 1050,
  
          sortable: true,
          viewrecords: true,
          postData: {
              rok: function () {
                  return $("#lata option:selected").val();
              }
          },
  
          treeGrid: true,
          treeGridModel: "adjacency",
          ExpandColumn: 'data',
          treeIcons: { leaf: 'ui-icon-document' },
  
      //            editurl: 'edit url',
  
      });
  });
  </code></pre>
  
  <p>formatter and unformat:</p>
  
  <pre><code>    function cboxFormatter(cellvalue, options, rowObject) {
          if (rowObject[11] == "true") { //isChild - how else can I check this?
              return '&lt;input type="checkbox"' + (cellvalue ? ' checked="checked"' : '') + '/&gt;';
          }
          else {
              return '&lt;input type="checkbox"' + (cellvalue ? ' checked="checked"' : '') +
                 'onclick="zaznacz(' + options.rowId + ')" /&gt;';
          }
      }
  
      function cboxUnFormatter(cellvalue, options, cell) {
          return $('input', cell).attr("checked") ? 'True' : 'False';
      }
  </code></pre>
  
  <p>and the CLUE: at first load all checkboxes are checked, it is ok, I try to "un-check" child by clicking parent</p>
  
  <pre><code>    function zaznacz(e) {
          var localRow = $('#list2').jqGrid('getLocalRow', e),
          children = $('#list2').jqGrid('getNodeChildren', localRow);
  
          var Row = $('#list2').jqGrid('getRowData', e);
  
          for (i = 0; i &lt; children.length; i++) {
              //alert(children[i].id); OK
  
              //$('#list2').jqGrid('setCell', children[i].id, 'zatwierdz', "False");
              $('#list2').jqGrid('getLocalRow', children[i].id).zatwierdz = "False";
              //localRow.zatwierdz = 'False';
              alert($('#list2').jqGrid('getLocalRow', children[i].id).zatwierdz);
  
      NO EFFECT AT ALL! even if I do:
      alert($('#list2').jqGrid('getLocalRow',children[i].id).zatwierdz);
      alert is OK, "False" is printed, but checkbox reamins checked (unchanged)
  
  
          }
      }
  </code></pre>
  
  <p>my JSON from MVC Controller:</p>
  
  <pre><code>    var data = new
  {
          rows = (
                  from du in dni
                      select new
                          {
                              cell = new string[] {
                              du.id, 
                              du.data,
                              du.typ,
                              du.ileDni,
                              du.ileGodzin,
                              du.zatwierdzalny,
                              du.anulowalny,
                              du.zatwierdz,
                              du.anuluj,
                              du.level,
                              du.parent,
                              du.isLeaf ? "true":"false",
                              du.expanded ? "true":"false",
                              du.loaded ? "true":"false"
                          }
                          }).ToArray()
  
  };
  </code></pre>
  
  <p>return Json(data, JsonRequestBehavior.AllowGet);</p>