RealGrid2 API
Interface
CellLayoutColumnItem

CellLayoutColumnItem

Column Layout Information Model

Signature:

export interface CellLayoutColumnItem extends CellLayoutItem

Extends: CellLayoutItem

Remarks

The model can be returned from GridBase.getLayoutByColumn().

When set to GridBase.setColumnLayout(), only specific properties can be used.

It can be set as a property of GridColumn.layout.

Inherits CellLayoutItem.

[Superclass]

CellLayoutItem

Example

// If it is a return value
{
      mergeRule: undefined,
      breakMergeOnEmpty: false;
      equalBlank: undefined,
      equalBlankExpression: undefined,
      cellSpan: 1;
      headerSpan: undefined,
      summarySpan: undefined,
      footerSpan: undefined,
      dataSpan: undefined,
      spanCallback: undefined,
      visible: true;
      vindex: 1;
      width: 100,
      fillWidth: NaN;
      cellWidth: 250
}
 
// When set to method
{
      column: 'Country'
      cellSpan: 3;
      width: 100,
}
 
{
      column: 'Country'
      headerSpan: 2;
      summarySpan: 2;
      footerSpan: 2;
      dataSpan: 4;
}
 
// When set to a column
column.layout.spanCallback = function (grid, layout, itemIndex) {
     var value = grid.getValue(itemIndex, layout.column.name);
     if (value) {
         return value[0] === "B" ? 2: value[0] === "F" ? 3:1;
     }

Events

PropertyTypeDescription
footerSpanCallbackSummaryCellSpanCallbackCallback for custom footer span
groupFooterSpanCallbackGroupFooterCellSpanCallbackCallback for custom groupFooter span
groupFooterUserSpanCallbackGroupFooterUserSpanCallbackCallback for custom groupFooter UserSpan Unlike groupFooterSpanCallback, it can span in block units.
spanCallbackCellSpanCallbackCallbacks for custom spans
summarySpanCallbackSummaryCellSpanCallbackCallback for custom headerSummary span

Properties

PropertyTypeDescription
breakMergeOnEmptybooleanWhether to stop merging when there is an empty cell
cellSpannumberDefault cell span count
columnstring | ValueColumnColumn name
dataSpannumberCell span count
equalBlankbooleanWhether to bundle cells when the value is the same as the cell in the previous row of the same column
equalBlankExpressionstringFormula to be treated as the same value if equalBlank is true
footerSpannumberWhen there is only one footer, specify the span of the footer for each column layout.
footerSpansnumber[]Number of footer spans
footerUserSpansUserSpan[]custom footer span
groupFooterSpansnumber[]Group Footer Span Count
groupFooterUserSpansUserSpan[]custom groupFooter span
headerSpannumberHeader span count
mergeRulestring | { criteria: string; }Rules for merging columns
summarySpannumberWhen there is only one headerSummary, specify the span of headerSummary for each column layout.
summarySpansnumber[]summary Number of spans
summaryUserSpansUserSpan[]custom headerSummary span

Events Desc

footerSpanCallback

Callbacks for custom footer spans

Type - SummaryCellSpanCallback


groupFooterSpanCallback

Callback for custom groupFooter span

Type - GroupFooterCellSpanCallback


groupFooterUserSpanCallback

Callback for custom groupFooter UserSpan Unlike groupFooterSpanCallback, it can span in block units.

Type - GroupFooterUserSpanCallback


spanCallback

Callbacks for custom spans

Type - CellSpanCallback

Example:

let layout = column.layout
layout.spanCallback = function (grid, layout, itemIndex) {
 var value = grid.getValue(itemIndex, layout.column.dataIndex);
 if (value) {
 return value[0] === "B" ? 3: value[0] === "F" ? 2:1;
 }
 return 1;
};

summarySpanCallback

Callback for custom headerSummary span

Type - SummaryCellSpanCallback


Properties Desc

breakMergeOnEmpty

Whether to stop merging when there is an empty cell

Type - boolean


cellSpan

Default cell span count

Type - number

Remarks:

When no other span is specified, the corresponding value is followed.

Can be used when set to GridBase.setColumnLayout().


column

Column name

Type - string | ValueColumn


dataSpan

Cell span count

Type - number

Remarks:

If the direction of the parent group is vertical, it is rowSpan, and if it is horizontal, it is colSpan. Can be used when set to GridBase.setColumnLayout().


equalBlank

Whether to bundle cells when the value is the same as the cell in the previous row of the same column

Type - boolean


equalBlankExpression

Formula to be treated as the same value if equalBlank is true

Type - string


footerSpan

When there is only one footer, specify the span of the footer for each column layout.

Type - number


footerSpans

Number of footer spans

Type - number[]

Remarks:

If there is only one footer, it is designated as footerSpan. Can be used when set to GridBase.setColumnLayout().


footerUserSpans

custom footer span

Type - UserSpan[]


groupFooterSpans

Number of group footer spans

Type - number[]

Remarks:

If there is only one groupFooter, specify it as groupFooterSpan. Can be used when set to GridBase.setColumnLayout().


groupFooterUserSpans

Custom groupFooter span

Type - UserSpan[]


headerSpan

Header span count

Type - number

Remarks:

Can be used when set to GridBase.setColumnLayout().


mergeRule

Rules for merging columns

Type - string | { criteria: string; }

Remarks:

If undefined (default), merge using the mergeRule of the column. If null, the mergeRule of the column is ignored. {criteria: string} is used for compatibility with previous versions.


summarySpan

When there is only one headerSummary, specify the span of headerSummary for each column layout.

Type - number


summarySpans

summary Number of spans

Type - number[]

Remarks:

If there is only one summary, specify it as summarySpan. Can be used when set to GridBase.setColumnLayout().


summaryUserSpans

Custom headerSummary span

Type - UserSpan[]