Link

Smart Button

Smart Button is an model and has some property.

export class SmartButton {
    type: SmartButtonType;
    content: string;
    htmlClass?: string;
    visible: boolean;
    title?: string;
    action: () => void;
    buttons?: SmartButton;
}
PropertyExplanation
typeButtonType
contenthtml content of button
visiblevisibility of button
htmlClasshtml class of button
actionemittable click event when button click
buttonsbuttons of button

Example SmartButton


model: SmartModel = {
    properties: [
      ...
    ],
    buttons: [
      {
        content: 'Custom',
        type: SmartButtonType.Custom,
        visible: true,
        action: this.btnCustomButtonClick
      },
      {
        content: 'Custom Excel Button',
        type: SmartButtonType.Excel,
        visible: true,
        action: this.btnCustomExcelButtonClick
      }
    ]
};

btnCustomButtonClick() {
   console.log(`Custom Button Click`);
}

btnCustomExcelButtonClick() {
   console.log(`Custom Excel Button Click`);
}