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]
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
Property | Type | Description |
---|---|---|
footerSpanCallback | SummaryCellSpanCallback | Callback for custom footer span |
groupFooterSpanCallback | GroupFooterCellSpanCallback | Callback for custom groupFooter span |
groupFooterUserSpanCallback | GroupFooterUserSpanCallback | Callback for custom groupFooter UserSpan Unlike groupFooterSpanCallback, it can span in block units. |
spanCallback | CellSpanCallback | Callbacks for custom spans |
summarySpanCallback | SummaryCellSpanCallback | Callback for custom headerSummary span |
Properties
Property | Type | Description |
---|---|---|
breakMergeOnEmpty | boolean | Whether to stop merging when there is an empty cell |
cellSpan | number | Default cell span count |
column | string | ValueColumn | Column name |
dataSpan | number | Cell span count |
equalBlank | boolean | Whether to bundle cells when the value is the same as the cell in the previous row of the same column |
equalBlankExpression | string | Formula to be treated as the same value if equalBlank is true |
footerSpan | number | When there is only one footer, specify the span of the footer for each column layout. |
footerSpans | number[] | Number of footer spans |
footerUserSpans | UserSpan[] | custom footer span |
groupFooterSpans | number[] | Group Footer Span Count |
groupFooterUserSpans | UserSpan[] | custom groupFooter span |
headerSpan | number | Header span count |
mergeRule | string | { criteria: string; } | Rules for merging columns |
summarySpan | number | When there is only one headerSummary, specify the span of headerSummary for each column layout. |
summarySpans | number[] | summary Number of spans |
summaryUserSpans | UserSpan[] | 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[]