mattiash / angular-tablesort

Sort angularjs tables easily
MIT License
184 stars 66 forks source link

Add attribute to disable sorting #100

Closed rycornell closed 7 years ago

rycornell commented 7 years ago

This addresses an issue that exists today where the table is not sorted correctly. The following conditions must be met for this to occur:

  1. None of the table headers contain the ts-criteria attribute
  2. Chrome is the browser
  3. There are more than 10 items in the array

When none of the table headers contain the ts-criteria attribute, I would expect the order of the items in the array to remain unchanged. However, that is not the case. Here is a plunk to reproduce the issue as well as the fix that I am submitting with this PR.

https://run.plnkr.co/plunks/vnpmSm/

The fix I am proposing introduces a new attribute that explicitly tells the directive not to perform the sort.

This is useful in cases where you may want to take advantage of only the paging and filtering capabilities of this directive.