RealGrid2 API
Interface
ColumnStyleObject

ColumnStyleObject

One of the style models that must be returned when changing the cell style with CellStyleCallback

Signature:

export interface ColumnStyleObject

Remarks

Used in GridBase.setCellStyleCallback() or ValueColumn.styleCallback.

Example

// Apply per column
let column = gridView.columnByName('Company');
 
const f = function (grid, cell) {
      return {
          styleName: 'custom-column'
      }
}
column.styleCallback = f;
 
// Apply to each data cell
gridView.setCellStyleCallback(f);

Properties

PropertyTypeDescription
booleanFormatstringWhen the value is of type Boolean, Format
buttonCellButtonSpecifies the type of CellButton to be displayed in the cell.
buttonWidthnumberChange the width of CellButton.
cellProtectPropsCellProtectPropertiesWhen exporting to Excel, set to lock cells or hide formulas.
datetimeFormatstringWhen the value is in date format, Format
editablebooleanEditable with editor
editorCellEditor | ConfigObjectEditor
excelFormatstringSpecify the format when exporting to Excel.
exportStyleNamestringStyle name to be applied when exported to Excel
numberFormatstringWhen the value is in numeric format, Format
prefixstringText to be displayed in front of the value
readOnlybooleanModification possible or prohibited
rendererCellRenderer | ConfigObjectrenderer
stylePartial<CSSStyleDeclaration>Used when specifying inline-style.
styleNamestringstyle name
suffixstringText to be added to the end of the value
textstringtext to be displayed in the cell instead of data
textFormatstringWhen the value is in text format, Format

Properties Desc

booleanFormat

Formatting when the value is of type Boolean

Type - string

Remarks:

If this value is specified, it is used as a conversion format when outputting the value of a boolean field.

If not specified, the value set in the data field is used.

Separated with a colon (:) or semicolon (;), the left side is false, and the right side is true.

Example) 'Nub: Yub'


button

Specifies the type of CellButton to be displayed in the cell.

Type - CellButton


buttonWidth

Change the width of CellButton.

Type - number


cellProtectProps

When exporting to Excel, set to lock cells or hide formulas.

Type - CellProtectProperties

Remarks:

If not specified, DataColumn.cellProtectProps is applied. Use with GridExportOptions.sheetProtect.


datetimeFormat

Format when the value is in date format

Type - string


editable

Can be edited with editor

Type - boolean


editor

editor

Type - CellEditor | ConfigObject


excelFormat

Specify the format when exporting to Excel.

Type - string

Remarks:

If not specified, DataColumn.excelFormat or format according to dataType is applied.


exportStyleName

Style name to be applied when exported to Excel

Type - string


numberFormat

Format when the value is in numeric format

Type - string


prefix

Text to display in front of the value

Type - string


readOnly

Editable or prohibited?

Type - boolean


renderer

renderer

Type - CellRenderer | ConfigObject


style

Used when specifying inline-style.

Type - Partial<CSSStyleDeclaration>

Remarks:

Specifies properties to add to the style of td.


styleName

style name

Type - string


suffix

Text to be added to the end of the value

Type - string


text

데이터 대신 셀에 표시될 text

Type - string

Remarks:

DataColumn.lookupDisplay 또는 DataColumn.displayCallback 보다 먼저 적용된다.


textFormat

Formatting when the value is in text format

Type - string