title: PrimeNg <p-table> sorting
body: <p>I am using primeNg <code>&lt;p-table&gt;</code>. I want to implement sorting of data. What I did is below</p>
  
  <p>sort.HTML</p>
  
  <pre><code>&lt;p-table [columns]="cols" [value]="documents"&gt;
      &lt;ng-template pTemplate="header" let-columns&gt;
          &lt;tr&gt;
              &lt;th *ngFor="let col of columns" [pSortableColumn]="col.field"&gt;
                  {{col.header}}
                  &lt;p-sortIcon [field]="col.field"&gt;&lt;/p-sortIcon&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/ng-template&gt;
      &lt;ng-template pTemplate="body" let-doc&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  {{doc.sName}}
              &lt;/td&gt;
  
          &lt;td&gt;
                  {{doc.sYear}}
              &lt;/td&gt;
          &lt;td&gt;
                  {{doc.sAge}}
              &lt;/td&gt;
          &lt;td&gt;
                  {{doc.sColor}}
              &lt;/td&gt;        
          &lt;/tr&gt;
      &lt;/ng-template&gt;
  &lt;/p-table&gt;
  </code></pre>
  
  <p>sort.ts</p>
  
  <pre><code>this.cols = [
              { field: 'name', header: 'Name' },
              { field: 'year', header: 'Year' },
              { field: 'age', header: 'Age' },
              { field: 'color', header: 'Color' }
          ];
  
  ngOnInit(){
      //made a service call and got data for
  
  this.documents=[{
  "sName":"Jhon",
  "sYear":"1994",
  "sAge":"20",
  "sColor":"Red"
  },
  {
  "sName":"Sam",
  "sYear":"1996",
  "sAge":"25",
  "sColor":"Red"
  },
  {
  "sName":"Anna",
  "sYear":"1991",
  "sAge":"21",
  "sColor":"Green"
  },
  {
  "sName":"Jhon",
  "sYear":"1999",
  "sAge":"25",
  "sColor":"Blue"
  },
  {
  "sName":"Betty",
  "sYear":"1993",
  "sAge":"35",
  "sColor":"Red"
  }]
  }
  </code></pre>
  
  <p>As of now only <code>Name</code> field is getting sorted, how can I implement sorting in other columns as well? I used <code>[pSortableColumn]</code> but columns are not getting sorted, I am missing out of somepoint. Can you please guide me where I am wrong? </p>
  
  <p>PS: I cannot used <code>&lt;p-dataTable&gt;</code>.</p>