angular-ui/ui-grid

Sorting on nested object does not seem to work.

Open

#4,293 opened on Aug 31, 2015

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
help wantedneeds: analysis

Description

I have some columns with nested objects.

    var columnDefs = [
            {
                type: String,
                field: 'agent.name',
                displayName: 'Set',
                filter: {
                    condition: uiGridConstants.filter.CONTAINS
                }
            },
            {
                type: String,
                field: 'colorprofileName',
                displayName: 'Color profile',
                filter: {
                    condition: uiGridConstants.filter.CONTAINS
                },
                cellTemplate: '<a href=" ' + CONFIG.api.url + '/color-profile/download/{{row.entity._id}}">{{row.entity.colorprofile.name}}</a>'
            }
}

When I try to sort it throws this error:

Error: No sorting function found for type:function String() {
    [native code]
}

Filtering does seem to work by default, is there a specific way nested objects need to be configured for sorting?

Contributor guide