How to use the @clr/angular.ClrDatagridSortOrder.DESC function in @clr/angular

To help you get started, we’ve selected a few @clr/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 vmware / clarity / latest / src / app / documentation / demos / datagrid / sorting / sorting.ts View on Github external
import {User} from "../inventory/user";
import {ClrDatagridSortOrder} from "@clr/angular";
import {PokemonComparator} from "../utils/pokemon-comparator";
import {EXAMPLES} from "./examples";

@Component({
    selector: "clr-datagrid-sorting-demo",
    providers: [Inventory],
    templateUrl: "./sorting.html",
    styleUrls: ["../datagrid.demo.scss"]
})
export class DatagridSortingDemo {
    examples = EXAMPLES;
    users: User[];
    usersDeprecated: User[];
    sortOrder: ClrDatagridSortOrder = ClrDatagridSortOrder.DESC;
    sorted: boolean = false;
    descSort: ClrDatagridSortOrder = ClrDatagridSortOrder.DESC;

    pokemonComparator = new PokemonComparator();

    constructor(private inventory: Inventory) {
        inventory.size = 10;
        inventory.reset();
        this.users = inventory.all;
        this.usersDeprecated = inventory.all;
    }
}
github inspursoft / board / src / ui / src / app / service / step0-list-service / list-service.component.ts View on Github external
@Component({
  templateUrl: './list-service.component.html',
  styleUrls: ['./list-service.component.css']
})
export class ListServiceComponent extends ServiceStepComponentBase implements OnInit, OnDestroy {
  services: PaginationService;
  isInLoading = false;
  totalRecordCount = 0;
  pageIndex = 1;
  pageSize = 10;
  isBuildServiceWIP = false;
  isShowServiceCreateYaml = false;
  createServiceMethod: CreateServiceMethod = CreateServiceMethod.None;
  isActionWIP: Map;
  projectList: Array;
  descSort = ClrDatagridSortOrder.DESC;
  oldStateInfo: ClrDatagridStateInterface;
  private subscriptionInterval: Subscription;

  constructor(protected injector: Injector,
              private translateService: TranslateService,
              private viewRef: ViewContainerRef,
              private factory: ComponentFactoryResolver) {
    super(injector);
    this.subscriptionInterval = interval(10000).subscribe(() => this.retrieve(true, this.oldStateInfo));
    this.isActionWIP = new Map();
    this.projectList = Array();
  }

  ngOnInit(): void {
    this.k8sService.getProjects().subscribe((res: Array) => this.projectList = res);
  }
github inspursoft / board / src / ui / src / app / project / project.component.ts View on Github external
import { TranslateService } from "@ngx-translate/core";
import { Message, RETURN_STATUS } from "../shared/shared.types";

@Component({
  selector: 'project',
  styleUrls: ["./project.component.css"],
  templateUrl: 'project.component.html'
})
export class ProjectComponent implements OnInit {
  totalRecordCount: number;
  pageIndex: number = 1;  
  pageSize: number = 15;
  projects: Project[];
  currentUser: {[key: string]: any};
  isInLoading:boolean = false;
  descSort = ClrDatagridSortOrder.DESC;
  oldStateInfo: ClrDatagridStateInterface;
  constructor(
    private appInitService: AppInitService,
    private projectService: ProjectService,
    private messageService: MessageService,
    private sharedActionService: SharedActionService,
    private translateService: TranslateService,
    private selfView: ViewContainerRef) {
  }

  ngOnInit(): void {
    this.currentUser = this.appInitService.currentUser;
  }

  retrieve(state: ClrDatagridStateInterface): void {
    setTimeout(() => {
github inspursoft / board / src / ui / src / app / user-center / user-list / user-list.component.ts View on Github external
export class UserList implements OnInit, OnDestroy {
  _deleteSubscription: Subscription;
  userListData = Array();
  userListErrMsg = "";
  curUser: User;
  curEditModel = editModel.emNew;
  showNewUser = false;
  setUserSystemAdminWIP = false;
  isInLoading = false;
  totalRecordCount = 0;
  pageIndex = 1;
  pageSize = 15;
  authMode = '';
  currentUserID = 0;
  descSort = ClrDatagridSortOrder.DESC;
  oldStateInfo: ClrDatagridStateInterface;

  constructor(private route: ActivatedRoute,
              private userService: UserService,
              private appInitService: AppInitService,
              private translateService: TranslateService,
              private messageService: MessageService) {

  }

  ngOnInit() {
    this.authMode = this.appInitService.systemInfo.auth_mode;
    this.currentUserID = this.appInitService.currentUser.user_id;
  }

  ngOnDestroy(): void {
github inspursoft / board / src / ui / src / app / audit / operation-audit-list / list-audit.component.ts View on Github external
import { User } from "../../shared/shared.types";

@Component({
  selector: 'list-audit',
  templateUrl: './list-audit.component.html',
  styleUrls: ['./list-audit.component.css']
})
export class ListAuditComponent implements OnInit {
  endDate: Date;
  beginDate: Date;
  userNames: Array;
  isInLoading: boolean = false;
  auditsListData: Array;
  auditQueryData: AuditQueryData = new AuditQueryData();
  totalRecordCount: number = 0;
  descSort = ClrDatagridSortOrder.DESC;
  oldStateInfo: ClrDatagridStateInterface;
  objectQueryMap: Array<{key: string, title: string}>;
  actionQueryMap: Array<{key: string, title: string}>;
  actionStatusMap: Array<{key: string, title: string}>;

  constructor(private messageService: MessageService,
              private auditService: OperationAuditService) {
    let now: Date = new Date();
    this.beginDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
    this.endDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 0);
    this.auditsListData = Array();
    this.userNames = Array();
    this.auditQueryData = new AuditQueryData();
    this.objectQueryMap = Array<{key: string, title: string}>();
    this.actionQueryMap = Array<{key: string, title: string}>();
    this.actionStatusMap = Array<{key: string, title: string}>();