Search results

BeforeCellFormatArgs API in JavaScript (ES5) Spreadsheet API control

Specifies the event arguments triggered before applying cell formatting in the spreadsheet. This allows users to customize the formatting behavior before it is applied to the selected cells.

Properties

borderType

BorderType

Specifies the border type to be applied during the cell formatting. This can be one of the following types:

  • “Inner”: Applies the border inside the selected range.
  • “Outer”: Applies the border outside the selected range.
  • “Vertical”: Applies the border vertically between columns.
  • “Horizontal”: Applies the border horizontally between rows.

cancel

boolean

Specifies whether to cancel the cell or number formatting. If set to true, the formatting action is canceled and not applied to the selected range. If set to false, the formatting is applied as requested.

format

string

Specifies the format to be applied when applying number formatting. This is relevant only when requestType is set to “Number”. The format could be any standard number format (e.g., “Currency”, “Percentage”, etc.).

range

string

Specifies the range of cells to which the cell formatting should be applied. This is a string representing the range (e.g., “A1:C3”, “B2”, etc.). The range can be a single cell or a block of cells.

requestType

FormatType

Specifies the type of request: whether it is a cell format or a number format.

  • “CellFormat”: The request is for cell formatting (e.g., font, background color).
  • “NumberFormat”: The request is for number formatting (e.g., currency, date format).

sheetIndex

number

Specifies the sheet index where the cell formatting is to be applied. The index corresponds to the position of the sheet in the workbook (0-based index).

style

CellStyleModel

Specifies the styles to be applied during cell formatting. This object contains styling properties such as font, color, borders, etc.