angular-ui/ui-grid

Sorting on nested object does not seem to work.

Open

#4293 aperta il 31 ago 2015

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
help wantedneeds: analysis

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor