Skip to content

Sorting without default sorting is incorrect #89

@sakae-nakajima

Description

@sakae-nakajima

The table doesn't render records as given.

This is due to the following line:
https://github.com/mattiash/angular-tablesort/blob/master/js/angular-tablesort.js#L540

Print two arrays:
console.log(array);
console.log(arrayCopy);

You see different orders. The concat method changes the order based on $$hashKey allocated by angular.

This can be observed when you have a large set of records, than when you have a small set of records.

I ended up using track by {attr} to stop allocation of $$hashKey by angular.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions