How to use the @covalent/core/data-table.TdDataTableSortingOrder.Descending function in @covalent/core

To help you get started, we’ve selected a few @covalent/core 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 Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / catalog / datasource / api / browser.component.ts View on Github external
newData.sort((a, b) => {  // use a custom sort as TdDataTableService only does case-sensitive sorting
            let direction = 0;
            if (!Number.isNaN(Number.parseFloat(a[this.sortBy])) && !Number.isNaN(Number.parseFloat(b[this.sortBy]))) {
                direction = Number.parseFloat(a[this.sortBy]) - Number.parseFloat(b[this.sortBy]);
            } else if (typeof a[this.sortBy] === "string" && typeof b[this.sortBy] === "string") {
                direction = a[this.sortBy].localeCompare(b[this.sortBy]);
            } else {
                direction = a[this.sortBy] < b[this.sortBy] ? -1 : a[this.sortBy] > b[this.sortBy] ? 1 : 0;
            }
            return direction * (this.sortOrder === TdDataTableSortingOrder.Descending ? -1 : 1);
        });
        newData = this.dataTableService.pageData(newData, this.fromRow, this.currentPage * this.pageSize);
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / ops-mgr / alerts / alerts-table.component.ts View on Github external
/**
     * The time of the oldest alert from the last server response.
     * @type {number|null}
     */
    oldestTime: any = null;
    ALL_ALERT_TYPES_FILTER: any;
    direction: any;
    PAGE_DIRECTION: any;
    refreshing: any;
    deferred: any;
    promise: any;
    total: number = 0;
    page: number = 1;

    sortBy: string = "startTime";
    sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;

    columns: ITdDataTableColumn[] = [
        { name: 'level',  label: 'Level', sortable: true, filter: true },
        { name: 'state', label: 'State', sortable: true, filter: true },
        { name: 'typeDisplay', label: 'Type', sortable: true, filter: true},
        { name: 'startTime', label: 'Start Time', sortable: true, filter: true},
        { name: 'description', label: 'Description', sortable: false, filter: true}
      ];

    ngOnInit(){
        this.filterTable =  ObjectUtils.isDefined(this.query) ? this.query : '';
        this.pageName = ObjectUtils.isDefined(this.pageName) ? this.pageName : 'alerts';
        //Page State
        this.loading = true;
        this.showProgress = true;
        //Pagination and view Type (list or table)
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / ops-mgr / overview / feed-health / FeedHealthTableCardComponent.ts View on Github external
getFeedHealthQueryParams() {
            var limit = this.paginationData.rowsPerPage;
            var activeTab = this.tabService.getActiveTab(this.pageName);
            var tab = activeTab.title;
            var sort = this.sortFeed.sortBy;
            if (this.sortFeed.sortOrder == TdDataTableSortingOrder.Descending) {
                sort = "-" + sort;
            }
            var start = (limit * activeTab.currentPage) - limit;
            return {limit:limit,fixedFilter:tab,sort:sort,start:start,filter:this.filterFeed};
        }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / sla / service-level-agreements.component.ts View on Github external
*/
    creatingNewSla: boolean = false;

    /**
     * Either NEW or EDIT
     * @type {string}
     */
    mode: any = 'NEW';

    userSuppliedName: boolean = false;

    userSuppliedDescription: boolean = false;

    loadingMessage: any;

    sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;
    sortBy: string = 'name';

    pageSize: number = 5;
    fromRow: number = 1;
    searchTerm: string = '';

    filteredData: any[];
    filteredTotal: number = 0;

    currentPage: number = 1;

    columns: ITdDataTableColumn[] = [
        { name: 'name', label: 'Name', sortable: true, filter: true },
        { name: 'description', label: 'Description', sortable: true, filter: true },
        { name: 'feedNames', label: 'RelatedFeeds', sortable: true, filter: true }
    ];
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / catalog / datasource / preview-schema / dataset-simple-table.component.ts View on Github external
/**
     * sorted/filtered data displayed in the ui
     * @type {any[]}
     */
    filteredData:any[] = [];

    /**
     * Calc the column width based upon data?
     */
    @Input()
    calcColumnWidth:boolean = true;


    sortBy: string = '';

    sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;



    sort(sortEvent: ITdDataTableSortChangeEvent): void {
        this.sortBy = sortEvent.name;
        this.sortOrder = sortEvent.order;
        this.filter();
    }

    filter(){
        let newData:any[] = this.data;
        newData = this._dataTableService.sortData(newData, this.sortBy, this.sortOrder);
        this.filteredData = newData;
    }
github Teradata / kylo / ui / ui-app / src / main / resources / static / js / feed-mgr / shared / domain-type / apply-domain-types / apply-domain-types-dialog.component.ts View on Github external
/**
     * sorted/filtered data displayed in the ui
     * @type {any[]}
     */
    filteredData:ApplyDomainTypesRow[] = [];

    /**
     * Rows selected
     * @type {any[]}
     */
    selectedRows:ApplyDomainTypesRow[] = [];

    sortBy: string = 'name';

    sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;



    constructor(
        private _dataTableService: TdDataTableService,
        public dialogRef: MatDialogRef,
        @Inject(MAT_DIALOG_DATA) public dialogData: ApplyDomainTypesData) {
    }

    sort(sortEvent: ITdDataTableSortChangeEvent): void {
        this.sortBy = sortEvent.name;
        this.sortOrder = sortEvent.order;
        this.filter();
    }

    filter(){