How to use the igniteui-angular.SortingDirection.Desc function in igniteui-angular

To help you get started, we’ve selected a few igniteui-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IgniteUI / igniteui-angular-samples / src / app / utilities / excel-exporter.ts View on Github external
}
                    }
                }
            }
        }

        // apply the sort...
        if (this.sortExpressions.length > 0) {
            const adder: (idx: number, cond: SortCondition) => void = table != null
              ? (i, c) => table.sortSettings.sortConditions().addItem(table.columns(i), c)
              : (i, c) => region.worksheet.filterSettings.sortSettings.
              sortConditions().addItem(new RelativeIndex(i), c);
            let isCaseSensitive: boolean; // = undefined;

            for (const sortExp of this.sortExpressions) {
                const sortDir = sortExp.dir === SortingDirection.Desc
                    ? SortDirection.Descending : SortDirection.Ascending;
                const sortCondition = new OrderedSortCondition(sortDir);
                const relIdx = this.fieldIndexMap[sortExp.fieldName];
                if (isCaseSensitive === undefined && sortExp.ignoreCase !== undefined) {
                    isCaseSensitive = sortExp.ignoreCase;
                }
                adder(relIdx, sortCondition);
            }

            if (table) {
                table.sortSettings.caseSensitive = isCaseSensitive === true;
            } else {
                region.worksheet.filterSettings.sortSettings.caseSensitive = isCaseSensitive === true;
            }
        }
    }
github IgniteUI / igniteui-angular-samples / src / app / treegrid-finjs / tree-grid-finjs-sample.component.ts View on Github external
public ngOnInit() {
        this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
        this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
        this.volumeChanged.subscribe(
            (x) => {
                this.localService.getData(this.volume);
            },
            (err) => console.log("Error: " + err));
    }
github IgniteUI / igniteui-angular-samples / src / app / grid-finjs / grid-finjs-demo.component.ts View on Github external
public ngOnInit() {
        this.grid1.groupingExpressions = [{
            dir: SortingDirection.Desc,
            fieldName: "Category",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        },
        {
            dir: SortingDirection.Desc,
            fieldName: "Type",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        },
        {
            dir: SortingDirection.Desc,
            fieldName: "Contract",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        }
        ];
        this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
        this.volumeChanged.subscribe(
            (x) => {
                this.localService.getData(this.volume);
            },
            (err) => console.log("Error: " + err));
    }
github IgniteUI / igniteui-cli / templates / angular / igx-ts / custom-templates / tree-grid-finjs / files / src / app / __path__ / __name__.component.ts View on Github external
public ngOnInit() {
        this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
        this.volumeChanged = this.volumeSlider.onValueChange.pipe(debounce(() => timer(200)));
        this.volumeChanged.subscribe(
            (x) => {
                this.localService.getData(this.volume);
            },
            (err) => console.log('Error: ' + err));
    }
github IgniteUI / igniteui-angular-samples / src / app / excel-library / working-with / grids.component.ts View on Github external
public ngOnInit() {
        this.grid.sortingExpressions = [
            { dir: SortingDirection.Asc, fieldName: "ContactTitle", ignoreCase: true,
              strategy: DefaultSortingStrategy.instance() },
            { dir: SortingDirection.Desc, fieldName: "Country", ignoreCase: true,
              strategy: DefaultSortingStrategy.instance() }
        ];
    }
github IgniteUI / igniteui-angular-samples / src / app / tree-grid / tree-grid-summary2-sample / tree-grid-summary2-sample.component.ts View on Github external
public ngOnInit() {
        this.grid1.sortingExpressions = [
            { dir: SortingDirection.Desc, fieldName: "ID",
              ignoreCase: true, strategy: DefaultSortingStrategy.instance() }
        ];
    }
github IgniteUI / igniteui-angular-samples / src / app / grid-finjs / grid-finjs-demo.component.ts View on Github external
public ngOnInit() {
        this.grid1.groupingExpressions = [{
            dir: SortingDirection.Desc,
            fieldName: "Category",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        },
        {
            dir: SortingDirection.Desc,
            fieldName: "Type",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        },
        {
            dir: SortingDirection.Desc,
            fieldName: "Contract",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        }
github IgniteUI / igniteui-angular-samples / src / app / treegrid-finjs / tree-grid-finjs-sample.component.ts View on Github external
public ngOnInit() {
        if (this.theme) {
            document.body.classList.add("fin-dark-theme");
        }
        this.grid1.sortingExpressions = [{ fieldName: this.groupColumnKey, dir: SortingDirection.Desc }];
    }
github IgniteUI / igniteui-angular-samples / src / app / grid / grid-multi-row-layout / grid-multi-row-layout.component.ts View on Github external
templateUrl: "./grid-multi-row-layout.component.html"
})
export class GridMultiRowLayoutComponent {

    public sourceData = DATA;
    public group = [
        {
            dir: SortingDirection.Asc,
            fieldName: "Country",
            ignoreCase: false,
            strategy: DefaultSortingStrategy.instance()
        }
    ];
    public sort = [
        {
            dir: SortingDirection.Desc,
            fieldName: "CompanyName",
            ignoreCase: true
        }
    ];
}
github IgniteUI / igniteui-angular-samples / src / app / grid / services / remoteService.ts View on Github external
private _buildDataUrl(virtualizationArgs: any, sortingArgs: any): string {
        let baseQueryString = `${DATA_URL}?$count=true`;
        let scrollingQuery = EMPTY_STRING;
        let orderQuery = EMPTY_STRING;
        let query = EMPTY_STRING;

        if (sortingArgs) {
            let sortingDirection: string;
            switch (sortingArgs.dir) {
                case SortingDirection.Asc:
                    sortingDirection = SortOrder.ASC;
                    break;
                case SortingDirection.Desc:
                    sortingDirection = SortOrder.DESC;
                    break;
                default:
                    sortingDirection = SortOrder.NONE;
            }

            orderQuery = `$orderby=${sortingArgs.fieldName} ${sortingDirection}`;
        }

        if (virtualizationArgs) {
            let requiredChunkSize: number;
            const skip = virtualizationArgs.startIndex;
            requiredChunkSize = virtualizationArgs.chunkSize === 0 ? 11 : virtualizationArgs.chunkSize;
            const top = requiredChunkSize;
            scrollingQuery = `$skip=${skip}&$top=${top}`;
        }