title: How to write a custom sorting method for ngx-datatable column in Angular6?
body: <p>I have defined a ngx-datatable in my Angular6 project as follows and I need to sort the countries in below order in the table.</p>
  
  <p><em>Code-</em></p>
  
  <pre><code>&lt;ngx-datatable [rows]="rows" [limit]="20" [rowHeight]="35" [headerHeight]="35" [footerHeight]="35" [scrollbarV]="true"
  [columnMode]="'force'" class="material"&gt;
  &lt;ngx-datatable-column prop="name" name="name"&gt;
      &lt;ng-template ngx-datatable-cell-template let-value="value"&gt;
          {{value}}
      &lt;/ng-template&gt;
  &lt;/ngx-datatable-column&gt;
  &lt;ngx-datatable-column prop="country" name="country"&gt;
      &lt;ng-template ngx-datatable-cell-template let-value="value"&gt;
          {{value}}
      &lt;/ng-template&gt;
  &lt;/ngx-datatable-column&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>Order of the rows should be -  England &gt; America &gt; Russia
  </code></pre>
  
  <p>I can order columns Alphabetically as follows. </p>
  
  <pre><code>[sorts]="[{prop: 'country'}"
  </code></pre>
  
  <p>But I need to sort them as in above order. Rows are in this order. <strong>(England > America > Russia)</strong>.</p>
  
  <p>Please help me with the sorting or using a custom comparator in ngx-databale. Thanks</p>
  
  <p>Sample code in <a href="https://stackblitz.com/edit/ngx-column-reordering" rel="nofollow noreferrer">stackblitz</a></p>