title: How to write custom Sorting in ag-grid?
body: <p>I have a custom sorting function which sorts alphanumerically. I have set it to comparator as mentioned in ag-grid but, I dont find it working. Please put in some light.</p>
  
  <pre><code>var naturalSort = function(valueA, valueB, nodeA, nodeB, isInverted) {
  
        var NUMBER_GROUPS = /(-?\d*\.?\d+)/g;
  
        var aa = String(valueA).split(NUMBER_GROUPS),
          bb = String(valueB).split(NUMBER_GROUPS),
          min = Math.min(aa.length, bb.length);
  
        for (var i = 0; i &lt; min; i++) {
          var x = parseFloat(aa[i]) || aa[i].toLowerCase(),
            y = parseFloat(bb[i]) || bb[i].toLowerCase();
          if (x &lt; y) return -1;
          else if (x &gt; y) return 1;
        }
  
        return 0;
      };
  
  var columnDefs = [
      {headerName: "Name", field: "name", width: 110, comparator: naturalSort}
  
  ];
  
  
  var gridOptions = {
      columnDefs: columnDefs,
      rowData: null,
      enableSorting: true
  };
  </code></pre>