Skip to content

ButtonColumn

Show the button.

Constructor Properties

PropertyDescription
captionDefine button caption.

Style Properties

PropertyDescriptionDefault
buttonBgColorDefine background color of button.Resolve by the theme.
textAlignDefine the horizontal position of text in cell.'center'
textBaselineDefine the vertical position of text in cell.'middle'
colorDefine the color of cell.Resolve by the theme.
fontDefine the font of cell.--
paddingDefine the padding of cell. If you set 4 values separately, please set the Array.--
textOverflowDefine how to display when text overflows the area of a cell. clip or ellipsis is available.'clip'

In addition to this, the Standard styles is available.

html
<div class="sample1 demo-grid small"></div>
js
const grid = new cheetahGrid.ListGrid({
  parentElement: document.querySelector(".sample1"),
  header: [
    {
      caption: "Button1",
      width: 180,
      columnType: new cheetahGrid.columns.type.ButtonColumn({
        caption: "FIXED LABEL",
      }),
      action: new cheetahGrid.columns.action.ButtonAction({
        action(rec) {
          alert(JSON.stringify(rec));
        },
      }),
    },

    {
      caption: "Button2",
      field: "buttonCaption", // Get caption of button from record
      width: 180,
      columnType: "button",
      action: new cheetahGrid.columns.action.ButtonAction({
        action(rec) {
          alert(JSON.stringify(rec));
        },
      }),
    },
  ],
});
grid.records = [
  { buttonCaption: "BUTTON1" },
  { buttonCaption: "BUTTON2" },
  { buttonCaption: "BUTTON3" },
  { buttonCaption: "BUTTON4" },
  { buttonCaption: "BUTTON5" },
];