Link

Smart Action

Smart Action is an model and has some property.

export class SmartAction {
    type: ActionType;
    content: string;
    visible: boolean;
    click?: (item) => void;
}
PropertyExplanation
typeActionType
contenthtml content of action
visiblevisibility of action
clickemittable 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)}`);
}