ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

Sorting Column with Boolean Data

Open michas84 opened this issue 12 years ago • 3 comments

Is there any possibility to sort column with boolean data? I want to display a list of documents in table, docs have 'isRead' property (value true or false).

I tried

$scope.tableParams = new ngTableParams(
                {
                    page: 1,
                    count: 10,
                    sorting: {
                        IsRead: 'asc'
                    }
                },

but it doesn't work.

michas84 avatar Feb 28 '14 13:02 michas84

+1

gunta avatar Mar 24 '14 08:03 gunta

it's working.

michas84 avatar Jun 13 '14 10:06 michas84

I did this in controller, in getData function after ajax call (the obejcts proparty to sort by is 'IsNew'):

var orderedData = $filter('orderBy')(docs, ['-IsNew']);

michas84 avatar Oct 10 '16 07:10 michas84