diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts new file mode 100644 index 000000000..4ed5fdd58 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts @@ -0,0 +1,38 @@ +import { TableColumn, TableColumnProp } from '@swimlane/ngx-datatable'; + +import { CellTemplate } from '../enum/cell-template.enum'; + +export interface CdTableColumn extends TableColumn { + cellTransformation?: CellTemplate; + isHidden?: boolean; + prop: TableColumnProp; // Enforces properties to get sortable columns + customTemplateConfig?: any; // Custom configuration used by cell templates. + + /** + * Add a filter for the column if true. + * + * By default, options for the filter are deduced from values of the column. + */ + filterable?: boolean; + + /** + * Use these options for filter rather than deducing from values of the column. + * + * If there is a pipe function associated with the column, pipe function is applied + * to the options before displaying them. + */ + filterOptions?: any[]; + + /** + * Default applied option, should be value in filterOptions. + */ + filterInitValue?: any; + + /** + * Specify a custom function for filtering. + * + * By default, the filter compares if values are string-equal with options. Specify + * a customize function if that's not desired. Return true to include a row. + */ + filterPredicate?: (row: any, value: any) => boolean; +} |