Skip to content

Enhance sorting feature #4

@sergiofilhowz

Description

@sergiofilhowz

Create a Feature that allows every property on the projection to be sortable

The third argument on model.projection can be a config object with the property sortable: true, this allow every property in this projection to be sortable.

But if we want to sort by a enum property, it'll sort by the ordinal, create a feature to send the map (ordinal, originalText) to sort by the original text instead of ordinal.

// provided by an i18n layer
var statusMap = { 
    0: 'Inactive',
    1: 'Active',
    2: 'Cancelled'
};

model.list({
    projection: 'list',
    sort: { 
        name: 'status',
        using: statusMap 
    }
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions