title: PrimeNg Datatable Custom Sorting repeating itself
body: <p>I have a datatable in Angular 2 app where I want to custom sort a column.</p>
  
  <pre><code>&lt;p-column field="eligible" header="Eligible" sortable="custom" (sortFunction)="sortColumn($event)"&gt;&lt;/p-column&gt;
  </code></pre>
  
  <p>In my component file, I'm making an API call to get the sorted results from the backend based on some logic.</p>
  
  <pre><code>sortColumn(colName: any) {
    let columnName = undefined !== colName.field ? colName.field : colName;
    let sortObject: any = {};
    if (this.sortedColumn === columnName) {
     if (!this.sortAsc) {
       this.sortAsc = true;
       sortObject[columnName] = 'DESC';
     } else {
      this.sortAsc = false;
      sortObject[columnName] = 'ASC';
   }
   } else {
    this.sortedColumn = columnName;
    this.sortAsc = false;
    sortObject[columnName] = 'ASC';
   }
  this.getData(sortObject);
  }
  </code></pre>
  
  <p>This API in return gets the whole data back and reorders the view. Now what's happening here is that this method <strong>sortColumn()</strong> keeps getting called repeatedly.</p>
  
  <p>Can anyone please help me understand what might be causing this issue and how to resolve it?</p>