[]
Spill direction refers to the direction in which data automatically overflows from one cell to the adjacent cells, and the cell expands as needed to accommodate the results. To control how the data is spilled into cells in a ReportSheet, set the value of the spillDirection
property of the setTemplateCell
method.
SpreadJS supports the following values for the spillDirection
property:
Property Value | Output |
---|---|
spillDirection: 'Vertical' | |
spillDirection: 'Horizontal' | |
spillDirection: 'None' |
Steps to set the spill direction in TemplateSheet:
Define the table source in the DataManager.
Configure the type and binding options in the template cell.
Set the spillDirection
property value in the template cell.
The following code samples show how to set different spill directions for the cells.
// Vertical Spill Direction
templateSheet.setTemplateCell(1, 0, {
type: 'Group',
binding: `Orders[CustomerId]`,
spillDirection: 'Vertical',
});
// Horizontal Spill Direction
templateSheet.setTemplateCell(1, 0, {
type: 'Group',
binding: `Orders[CustomerId]`,
spillDirection: 'Horizontal',
});
// No Spill Direction
templateSheet.setTemplateCell(1, 0, {
type: 'Group',
binding: `Orders[CustomerId]`,
spillDirection: 'None',
});