samu/angular-table

Sort indicators don't show up

Closed this issue · 3 comments

How can I get the sort indicators to show up? I'm not using bootstrap, but Foundation - maybe this is why they don't show up? Is there any way to provide snippets of HTML for what the sort indicators should be, e.g. something like <i class="fi-arrow-up"></i> and <i class="fi-arrow-down"></i>?

Oops, I see now that they do show up - glyphicon-chevron-up and glyphicon-chevron-down classes are appearing and disappearing as they should. However, I need to provide a different icon.

I see a ng-class=getSortIcon(<fieldname>, predicate) in the HTML ... how do I access this function? It isn't clear from the examples you provided.

Thanks!

I figured out I can put it on my controller scope:

$scope.getSortIcon = function (predicate, currentPredicate) {
    if (predicate !== currentPredicate) {
        return '';
    }
    return 'fi-arrow-up';
};

How can I access whether it's ascending or descending, though?

I made a pull request #71 to fix this.