Skip to content

Instantly share code, notes, and snippets.

@PxyUp
Last active October 26, 2018 09:45
Show Gist options
  • Save PxyUp/bca8ebfa91d9bbc211b4fb39f0cff9ca to your computer and use it in GitHub Desktop.
Save PxyUp/bca8ebfa91d9bbc211b4fb39f0cff9ca to your computer and use it in GitHub Desktop.
virtual.table.config.ts
export interface VirtualTableConfig {
column?: Array<VirtualTableColumn>; // if config not provide will be auto generate column
filter?: boolean; // default false
header?: boolean; // default true
}
export interface VirtualTableColumn {
name?: string; // Label for field, if absent will be use key
key: string; // Uniq key for filed,
func?: (item: VirtualTableItem) => any; // function for get value from dataSource item
comp?: (a: any, b: any) => number; // function for compare two item, depend from `func` function
sort?: 'asc' | 'desc' | null | false; // sort by default(support only one sort), false for disable
resizable?: boolean; // default true(if not set `true`)
draggable?: boolean; // default true (if not set `true`)
component?: VirtualTableColumnComponent | false; // default false (You class component must be part of entryComponents in yor Module!!!!!)
}
export interface VirtualTableColumnComponent {
componentConstructor: Type<any>;
inputs?: Object; // default {}
outputs?: Object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment