Smart Action
Smart Action is an model and has some property.
export class SmartAction {
type: ActionType;
content: string;
visible: boolean;
click?: (item) => void;
}
Property | Explanation |
---|---|
type | ActionType |
content | html content of action |
visible | visibility of action |
click | emittable click event when action click |
Example SmartAction
model: SmartModel = {
properties: [
...
],
...,
actions: [
{
type: ActionType.Add,
content: '<input type="button" value="Add" class="add-item">',
visible: true
},
{
type: ActionType.Custom,
content: 'First Custom Button',
visible: true,
click: this.btnCustomClick
},
...
]
};
btnCustomClick(item: any) {
console.log(`Custom Action Click : ${JSON.stringify(item)}`);
}