src/app/shared/models/cd-table-action.ts
Properties |
|
Optional canBePrimary |
Type : function
|
Defined in src/app/shared/models/cd-table-action.ts:32
|
Defines if the button can become 'primary' (displayed as button and not 'hidden' in the menu). Only one button can be primary at a time. By default all 'create' actions can be the action button if no or multiple items are selected. Also, all 'update' and 'delete' actions can be the action button by default, provided only one item is selected. |
Optional click |
Type : Function
|
Defined in src/app/shared/models/cd-table-action.ts:10
|
Optional disable |
Type : function
|
Defined in src/app/shared/models/cd-table-action.ts:23
|
icon |
Type : string
|
Defined in src/app/shared/models/cd-table-action.ts:18
|
name |
Type : string
|
Defined in src/app/shared/models/cd-table-action.ts:15
|
permission |
Type : "create" | "update" | "delete" | "read"
|
Defined in src/app/shared/models/cd-table-action.ts:12
|
Optional routerLink |
Type : string | Function
|
Defined in src/app/shared/models/cd-table-action.ts:7
|
Optional visible |
Type : function
|
Defined in src/app/shared/models/cd-table-action.ts:36
|
import { CdTableSelection } from './cd-table-selection';
export class CdTableAction {
// It's possible to assign a string
// or a function that returns the link if it has to be dynamic
// or none if it's not needed
routerLink?: string | Function;
// This is the function that will be triggered on a click event if defined
click?: Function;
permission: 'create' | 'update' | 'delete' | 'read';
// The name of the action
name: string;
// The font awesome icon that will be used
icon: string;
// You can define the condition to disable the action.
// By default all 'update' and 'delete' actions will only be enabled
// if one selection is made and no task is running on the selected item.
disable?: (_: CdTableSelection) => boolean;
/**
* Defines if the button can become 'primary' (displayed as button and not
* 'hidden' in the menu). Only one button can be primary at a time. By
* default all 'create' actions can be the action button if no or multiple
* items are selected. Also, all 'update' and 'delete' actions can be the
* action button by default, provided only one item is selected.
*/
canBePrimary?: (_: CdTableSelection) => boolean;
// In some rare cases you want to hide a action that can be used by the user for example
// if one action can lock the item and another action unlocks it
visible?: (_: CdTableSelection) => boolean;
}