sort: function()

in webapp/components/flow-design-system/fds-demo.js [882:896]


    sort: function (sortEvent, column) {
        if (column.sortable) {
            const sortBy = column.name;
            column.sortOrder = (column.sortOrder === 'ASC') ? 'DESC' : 'ASC';
            const sortOrder = column.sortOrder;
            this.filter(sortBy, sortOrder);

            //only one column can be actively sorted so we reset all to inactive
            this.columns.forEach(function (c) {
                c.active = false;
            });
            //and set this column as the actively sorted column
            column.active = true;
        }
    },