title: jqGrid: Null Custom Formatter
body: <p>I would like to replace blank values in the grid with 'NULL'. I've read that null values in the data are displayed as empty cells by default in jqGrid. As per a special request I need to have those blank values formatted to read as 'NULL'.</p>
  
  <p>I found this relevant <a href="https://stackoverflow.com/questions/17024027/jqgrid-show-blank-instead-of-null">post</a> that is trying to do the opposite--replace 'NULL' with blank values. I used that code to set the cellvalue to 'NULL' instead of ' ' if the cell value is either undefined or isNull. But when I run the code the grid never loads. I just get the "loading..." message box and it never loads any data. </p>
  
  <p>Below is the code I used:</p>
  
  <pre><code>var nullFormatter = function(cellvalue, options, rowObject) {
      if(cellvalue === undefined || isNull(cellvalue)) {
          cellvalue = 'NULL';
      }
      return cellvalue;
  }
  
  
  $("#grid").jqGrid({
      ....
      colModel: [{
          label: 'Name',
          name:'name',
          index:'name',
          formatter:nullFormatter
      }, {
          label: 'Next Column',
          name:'nextCol',
          index:'nextCol',
          formatter: nullFormatter
      }, ...],
      ....
  }
  </code></pre>
  
  <p>Thanks in advance.</p>