Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 4, 2019. It is now read-only.
This repository was archived by the owner on Dec 4, 2019. It is now read-only.

Custom comparator is not working #302

Open

Description

I am trying to pass a custom comparator for a column but it is not getting called.

After researching the source code, I found that the comparator function is not passed while sorting the data.

 var clientSorts = [];
 for(var i=0, len=sorts.length; i < len; i++) {
 var c = sorts[i];
 if(c.comparator !== false){
 var dir = c.sort === 'asc' ? '' : '-';
 clientSorts.push(dir + c.prop);
 }
 }
 if(clientSorts.length){
 // todo: more ideal to just resort vs splice and repush
 // but wasn't responding to this change ...
 var sortedValues = this.$filter('orderBy')(this.rows, clientSorts);
 this.rows.splice(0, this.rows.length);
 this.rows.push(...sortedValues);
 }

Above snippet can be found here

I am trying these feature with the following versions:

  1. AngularJS v1.5.11
  2. angular-data-table v0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /