Class: GridLayout

GridLayout

layoutEngines/gridlayout.js, line 158

Creates a new instance of the GridLayout engine.

Parameters:
Name Type Description
options Object

An object used to initialize the GridLayout.

Name Type Default Description
rowHeaderWidth number 40 optional

The width of the row header cell.

colHeaderHeight number 24 optional

The height of the column header cell.

headerRow Object optional

An object used to define the headerRow configurations.

Name Type Description
visible boolean optional

Specifies whether the header row is visible.

height number optional

The header row height.

position string optional

The header row position. the value can be 'above' or 'below', the default value is 'below'.

separateColumn boolean optional

Specifies whether to show the entire header or show individual columns on the header row.

renderer string optional

The default header row renderer. If there is column header template, header row will use the template as layout structure.

footerRow Object optional

The grid footer settings.

Name Type Description
visible boolean optional

Specifies whether the grid footer is visible.

height number optional

The grid footer height.

data Object optional

The grid footer row initial data. It can be an object or a callback function.

rowHeight number 24 optional

The default row height

colWidth number | string '*' optional

The default column width.

colMinWidth number 8 optional

The default minimum column width.

showRowHeader boolean true optional

Specifies whether to show the row header.

showColHeader boolean true optional

Specifies whether to show the column header.

allowAutoAddRow boolean false optional

Specifies whether support allow user add new row by UIAction

autoAddRowPosition boolean 'top' optional

Specifies the new row position.

allowFocus boolean true optional

Specifies whether the layout engine can get focus.

allowEditing boolean false optional

Globally allows all columns to be editable

allowSorting boolean false optional

Globally allows all columns to be sortable.

allowCellMerging boolean false optional

Globally enable the cell merging.

cellMergingSettings.mode boolean 'restrict' optional

There are two modes 'restrict' and 'free'. If the mode is 'restrict', current column auto merge area will be restricted by previous column. Default mode is 'restrict'.

cellMergingSettings.onlyShowFirstRow boolean false optional

Specifies whether show the merged cell value only in the first row.

cellMergingSettings.alwaysShowText boolean false optional

Specifies whether show the merged cell text in the view.

cellMergingSettings.groupedColumn.showIcon boolean false optional

Specifies whether show grouped icon in merged cell.

selectionMode string 'single' optional

The selection mode. The value can be 'single','multiple', or 'none'.

selectionUnit string 'row' optional

Specifies selection unit. The value can be 'row' or 'cell'.

allowHeaderSelect boolean false optional

Specifies whether to show checkboxes on the row header. If true, the row can only be selected by checking the checkbox.

allowColumnReorder boolean true optional

Specifies whether the user can reorder columns at run time.

allowSwipe boolean false optional

Specifies whether to support the touch swipe action.

allowColumnResize boolean true optional

Specifies whether the user can resize columns at run time.

rightToLeft boolean false optional

Indicates whether to lay out elements from right to left.

editMode string 'inline' optional

Specifies which editing mode grid is used for editing. There are three modes 'inline', 'popup', and 'editForm'.

editUnit string 'row' optional

Specifies editing a cell or row in one time. There are two modes 'row' and 'cell'.

editRowTemplate string optional

The edit row template is used to customize the appearance of 'popup' mode and 'editForm' mode.

filterExpression string optional

A string filter expression used to filter the data collection.

allowGrouping boolean false optional

Specifies whether to show a group drag panel to help the user group the rows manually at run time.

defaultGroupingInfo Object optional

Default group setting object, settings in group descriptor has higher priority.

grouping Object | Array optional

A single group setting object or array of group setting objects used to initialize groups.

Name Type Description
field string optional

The column id used to group the column.

collapsed boolean optional

Specifies whether the group is collapsed.

preDefinedGroups Array optional nullable

The pre-defined group names that the user can customize.

converter Object optional

A function that is used to specify the group name. The function requires a cell value parameter when calling.

header Object optional

The group header settings.

Name Type Description
visible boolean optional

Specifies whether the group header is visible.

template string optional

The group header template.

height number optional

The group header height.

footer Object optional

The group footer settings.

Name Type Description
visible boolean optional

Specifes whether the group footer is visible.

template string optional

The group footer template.

columns Array optional

An array used to specify the individual column renderer or aggragate formulas on group footer area.

Name Type Description
id string optional

Column Id

groupFooter string optional

Column renderer or aggregate formula on the current group level, which has the higher priority compared with groupFooter defined on column config.

height number optional

The height of the group footer.

collapseWithGroup boolean optional

Specifes whether the footer is collapsed when the group is collapsed. If false, the footer remains visible even if the group is collapsed.

groupStrategy Object optional

A group strategy object used to define the group layout strategy.

rowTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of a row.

pinnedLeftRowTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of a pinned-left row.

pinnedRightRowTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of a pinned-right row.

colHeaderTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of column header row..

pinnedLeftColHeaderTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of a pinned-left column header row.

pinnedRightColHeaderTemplate string optional

A string that starts with '#'+templateID or a raw html string that represents the structure and layout of a pinned-right column header row.

hierarchy Object optional

A single hierarchy setting object used to initialize the hierarchy structure.

Name Type Description
keyField string optional

A column id whose dataField stores the name of the data item's unique field.

parentField string optional

A column id whose dataField stores the name of the data item's parent field.

collapsed boolean optional

The initial state of the tree node.

column string optional

A column id that the tree node is displayed on.

offset number | GC.Spread.Views.DataView~hierarchyOffsetCallback optional

The offset for the entire tree column. This can be a callback function to customize the offset.

offsetUnit number optional

If options.hierarchy.offset is not assigned, the offset is calculated by the node level and offsetUnit. The default value is 20px;

footer Object optional

Hierarchy structure footer setting.

Name Type Description
visible boolean optional

Specifies whether to show hierarchy footers.

height number optional

The height of the hierarchy footer. If not set, it is the height of its row.

template string optional

An html fragment that defines the footer's appearance. If not set, the footer uses the row template to render itself.

sorting Object | Array optional

A single sort setting object or array of sort setting objects used to initialize sorting.

Name Type Default Description
field string optional

The field the user wants to sort.

ascending boolean true optional nullable

Indicates the sort order. The default is true.

converter Object optional

The converter callback for sorting.

pageSize number optional

Show how many items in one page, this property only take effect if the paging pluggin is referenced.

startPageIndex number optional

The initial start page index, this property only take effect is the paging plugiin is referenced.

localeResource.groupDragText string optional

The placeHolder of grouping panel.

localeResource.toolPanelGroupPanelText string optional

The placeHolder of tool panel grouping part.

localeResource.toolPanelGroupPanelTitle string optional

The title of tool panel grouping part.

localeResource.toolPanelColPanelTitle string optional

The title of tool panel column operation part.

localeResource.addColPanelTitle string optional

The title of add column dialog.

localeResource.addColPanelText string optional

The placeholder of add column dialog.

localeResource.addColPanelErrorText string optional

The display text after insert column error.

localeResource.addText string optional

The display text of add button.

localeResource.cancelText string optional

The display text of cancel button.

localeResource.updateText string optional

The display text of update button.

localeResource.buildInActionSave string optional

The display text of build-in save action.

localeResource.buildInActionEdit string optional

The display text of build-in edit action.

localeResource.buildInActionCancel string optional

The display text of build-in cancel action.

localeResource.editFormTitle string optional

The title of edit form.

updateOverlayStatusCallback GC.Spread.Views.DataView~updateOverlayStatusCallback optional

The update overlay callback.

allowAsyncRender boolean false optional

Indicates whether to run asyncRender method in column.

Tutorials:
  • Tutorial: [object Object]