コード例 #1
0
        public async Task NextColumnSort(string id)
        {
            Column c = (Column)_columns[id];

            if (c.SortDirection == SortDirections.Neutral)
            {
                c.SortIndex = _currentSortIndex++;
            }

            c.SortDirection = c.SortDirection switch
            {
                SortDirections.Neutral => SortDirections.Ascending,
                SortDirections.Ascending => SortDirections.Descending,
                _ => SortDirections.Neutral
            };

            if (c.SortDirection == SortDirections.Neutral)
            {
                c.SortIndex = 0;
            }

            await StoreColumnConfig((Column)_columns[id]);

            _sortedRowCache = null;

            OnColumnSortUpdate.Invoke();
            ExecutePending();
        }
コード例 #2
0
        public async Task SetColumnSort(string id, SortDirections sortDirection, int index)
        {
            Column c = (Column)_columns[id];

            c.SortDirection = sortDirection;
            c.SortIndex     = index;

            await StoreColumnConfig((Column)_columns[id]);

            _sortedRowCache = null;

            OnColumnSortUpdate.Invoke();
            ExecutePending();
        }