# Data Grid

(part of package '[Servoy NG-Grids](/reference/servoyextensions/packages/ui-component-packages/servoy-ng-grids.md)')\
Extends designtime/SolutionModel: [JSWebComponent](/reference/servoycore/dev-api/solutionmodel/jswebcomponent.md)\
Extends runtime: [RuntimeWebComponent](/reference/servoycore/dev-api/forms/runtimeform/elements/runtimewebcomponent.md)

Data Grid is a table with advanced functionality that operates on JSFoundset data (so it can work directly with the database). It is designed to work with a large number of rows, potentially infinite, since data is loaded lazily into the table, even when grouped.

This is a reference page; many components have detailed usage guides [here](https://docs.servoy.com/guides/develop/application-design/ui-components).

## Properties

### arrowsUpDownMoveWhenEditing

Defines action on TEXTFIELD editor for up/down arrow keys Type: [String](/reference/servoycore/dev-api/js-lib/string.md)

***

### checkboxSelection

When true the row has a checkbox for selecting/unselecting Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### columns

List all columns to be used in table as dataprovider Type: [Array\<CustomType\<aggrid-groupingtable.column>>](#column)

***

### columnsAutoSizing

Auto sizing for columns. SIZE\_COLUMNS\_TO\_FIT: make the currently visible columns fit the screen. AUTO\_SIZE: the grid will work out the best width to fit the contents of the 'visible' cells in the column. NONE: no auto sizing action performed Type: [String](/reference/servoycore/dev-api/js-lib/string.md) Default Value: null

***

### columnsAutoSizingOn

Apply 'columnsAutoSizing' for these events even if 'continuousColumnsAutoSizing' is false Type: [CustomType\<aggrid-groupingtable.columnsAutoSizingOn>](#columnsautosizingon)

***

### continuousColumnsAutoSizing

Apply 'columnsAutoSizing' whenever columns width are changed Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### customMainMenu

Menu items to append to the columns menu, beside the default aggrid menus. Type: [JSMenu](/reference/servoycore/dev-api/menus/jsmenu.md)

***

### editNextCellOnEnter

Determines whether the focus should move to the next cell when Enter is pressed. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### enableBrowserContextMenu

When true the browser context menu is shown Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### enableColumnMove

If moving of columns is enabled Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### enableColumnResize

Allow the user to resize columns Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### enableSorting

Enable column sorting by clickin on the column's header Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### enabled

Flag indicating if the grid is enabled for user interaction. Type: [Enabled](/reference/servoy-developer/component_and_service_property_types.md#protected) Default Value: true

***

### gridOptions

Map where additional grid properties of ag-grid can be set Type: [Json](/reference/servoycore/dev-api/js-lib/json.md)

***

### groupCheckbox

When true the group has checkbox for selecting/unselecting all child rows Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### groupUseEntireRow

When true the group takes the entire row Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### iconConfig

Custom icon configuration for grid features (e.g., sort, filter, group icons). Type: [CustomType\<aggrid-groupingtable.iconConfig>](#iconconfig)

***

### localeText

Map where locales of ag-grid can be set Type: [Map](/reference/servoy-developer/component_and_service_property_types.md#map)

***

### mainMenuItemsConfig

Configuration for main menu items (customizes options like column pinning, sorting, etc.). Type: [CustomType\<aggrid-groupingtable.mainMenuItemsConfig>](#mainmenuitemsconfig)

***

### myFoundset

The foundset where data are fetched from Type: [JSFoundset](/reference/servoycore/dev-api/database-manager/jsfoundset.md) Default Value: {"foundsetSelector":""}

***

### onDragGetImageFunc

Called when row(s) drag-n-drop is started, to get the drag image as an html code. Type: [Clientfunction](/reference/servoy-developer/component_and_service_property_types.md#clientfunction)

***

### onDragOverFunc

Callback when dragging over a row - returns one of the strings: 'copy', 'move', 'none' depending on the allowed drag operation. Type: [Clientfunction](/reference/servoy-developer/component_and_service_property_types.md#clientfunction)

***

### readOnly

Flag indicating if the grid is in read‑only mode, disabling editing. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### responsiveHeight

Table's height to be set in a responsive form. When responsiveHeight is set to 0, the table will use 100% height of the parent container. When responsiveHeight is set to -1, the table will auto-size it's height to the number of rows displayed inside the grid - in this case there is no vertical scrollbar and all rows are rendered Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: 300

***

### rowHeight

The height in pixels of the table's rows Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: 25

***

### rowStyleClassDataprovider

Use dataSource calculation as rowStyleClassDataprovider to set styleClass conditionally to rows. The calculation should return the class name (or names) to be applied to the row Type: [Dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)

***

### showColumnsMenuTab

If the column selection panel should be shown in the column menu Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### showGroupCount

When true the number of rows for groups is shown, beside the name Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: false

***

### showLoadingIndicator

When true, shows a loading indicator while data is being fetched or refreshed. Type: [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) Default Value: true

***

### styleClass

CSS class for the cell. Type: [Styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass) Default Value: "ag-theme-alpine"

***

### tabSeq

Tab sequence index used for keyboard navigation in the grid. Type: [Tabseq](/reference/servoy-developer/component_and_service_property_types.md#tabseq)

***

### toolPanelConfig

Configuration object for the ag‑grid tool panel (e.g., which panels to show, button behavior). Type: [CustomType\<aggrid-groupingtable.toolPanelConfig>](#toolpanelconfig)

***

### tooltipTextRefreshData

Tooltip text shown when hovering the refresh button Type: [Tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring) Default Value: "Refresh for latest data !"

***

### visible

Controls the visibility of the grid component. Type: [Visible](/reference/servoy-developer/component_and_service_property_types.md#visible)

***

## Events

### onCellClick(foundsetindex,columnindex,record,event,dataTarget)

Called when the mouse is clicked on a row/cell.\
The foundsetindex is always -1 when there are grouped rows.\
If a column is disabled (enabled = false), ensure that you only execute code for that column if columnindex corresponds to it.

**@private**

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} foundsetindex - The index of the clicked row in the foundset (or -1 for grouped rows).
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} columnindex - The index of the clicked column in the grid.
> * {[JSRecord](/reference/servoycore/dev-api/database-manager/jsrecord.md)} record - The record object corresponding to the clicked row. (Optional)
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] - The event object associated with the click. (Optional)
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[dataTarget] - Optional identifier indicating the target data context. (Optional)

***

### onCellDoubleClick(foundsetindex,columnindex,record,event,dataTarget)

Called when the mouse is double-clicked on a row/cell.\
The foundsetindex is always -1 when there are grouped rows.\
If a column is disabled (enabled = false), ensure that you only execute code for that column if columnindex corresponds to it.

**@private**

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} foundsetindex - The index of the double-clicked row in the foundset (or -1 for grouped rows).
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindex] - The index of the double-clicked column in the grid. (Optional)
> * {[JSRecord](/reference/servoycore/dev-api/database-manager/jsrecord.md)} \[record] - The record object corresponding to the double-clicked row. (Optional)
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] - The event object associated with the double-click. (Optional)
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[dataTarget] - Optional identifier indicating the target data context. (Optional)

***

### onCellRightClick(foundsetindex,columnindex,record,event,dataTarget)

Called when the right mouse button is clicked on a row/cell.\
The foundsetindex is always -1 when there are grouped rows.\
If a column is disabled (enabled = false), ensure that you only execute code for that column if columnindex corresponds to it.

**@private**

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} foundsetindex - The index of the row where the right-click occurred (or -1 for grouped rows).
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindex] - The index of the right-clicked column in the grid. (Optional)
> * {[JSRecord](/reference/servoycore/dev-api/database-manager/jsrecord.md)} \[record] - The record object corresponding to the right-clicked row. (Optional)
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] - The event object associated with the right-click. (Optional)
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[dataTarget] - Optional identifier indicating the target data context. (Optional)

***

### onColumnDataChange(foundsetindex,columnindex,oldvalue,newvalue,event,record)

Called when the columns data is changed

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} foundsetindex The index of the row that changed (1-based).
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindex] The index of the column that changed (0-based).
> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} \[oldvalue] The previous value of the cell.
> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} \[newvalue] The new value of the cell.
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] The event object associated with the data change.
> * {[JSRecord](/reference/servoycore/dev-api/database-manager/jsrecord.md)} \[record] The record object representing the changed row.

**Returns:** {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)}

***

### onColumnFormEditStarted(foundsetindex,columnindex,value)

Called when the column's form editor is started

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[foundsetindex] The row index where editing starts.
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindex] The column index where editing starts.
> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} \[value] The initial value of the cell being edited.

***

### onColumnStateChanged(columnState,event)

Called when the columns state is changed

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} columnState The new serialized state of the columns (e.g., widths, order, visibility).
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] The event object triggering the state change.

***

### onCustomMainMenuAction(menuItemName,colId)

Called when a custom main menu item is chosen.

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} menuItemName The name of the custom menu item that was selected.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} colId The column identifier associated with the menu action.

***

### onDrop(sourceRows,targetRecord,event)

Called when a row is dropped as a result of a drag-n-drop

**Parameters:**

> * {[Array\<Object>](/reference/servoycore/dev-api/js-lib/object.md)} sourceRows An Array of JSRecord objects if dragged from a data grid, or plain objects if from a power grid
> * {[JSRecord](/reference/servoycore/dev-api/database-manager/jsrecord.md)} targetRecord The target record where the rows were dropped.
> * {[CustomType\<aggrid-groupingtable.JSDNDEvent>](#jsdndevent)} event The event object associated with the drop action.

***

### onElementDataChange()

***

### onFooterClick(columnindex,event,dataTarget)

Called when the mouse is clicked on a footer cell

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindex] The index of the footer cell that was clicked.
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] The event object associated with the click.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[dataTarget] Optional identifier indicating the target data context of the click.

***

### onReady()

Called when the table is ready to be shown

***

### onRowGroupOpened(groupcolumnindexes,groupkeys,isopened)

Called when group is opened/closed

**Parameters:**

> * {[Array\<Number>](/reference/servoycore/dev-api/js-lib/number.md)} \[groupcolumnindexes] An array of column indexes associated with the group.
> * {[Array\<Object>](/reference/servoycore/dev-api/js-lib/object.md)} \[groupkeys] An array of keys representing the group hierarchy.
> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[isopened] True if the group is opened; false if closed.

***

### onSelectedRowsChanged(isgroupselection,groupcolumnid,groupkey,groupselection,event)

Called when the selected rows have changed.

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[isgroupselection] Indicates if the selection change pertains to a group row.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[groupcolumnid] The ID of the column used for grouping, if applicable.
> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} \[groupkey] The key identifying the group whose selection has changed.
> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[groupselection] True if the entire group is selected; false if deselected.
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} \[event] - The event object associated with selection changed. (Optional)

***

### onSort(columnindexes,sorts)

Called when sort has changed

**Parameters:**

> * {[Array\<Number>](/reference/servoycore/dev-api/js-lib/number.md)} \[columnindexes] An array of column indexes that have been sorted.
> * {[Array\<String>](/reference/servoycore/dev-api/js-lib/string.md)} \[sorts] An array of sort orders (e.g., 'asc', 'desc') corresponding to the sorted columns.

***

## API

### addFunctionCall(alias,f)

Add a Servoy solution function to the grid, that can be called from AGGRID using params.context.componentParent.executeFunctionCall

**Example:**

```js
function onLoad(event) {
	var f = function(params) {		
	     var generalMenuItems = ['pinSubMenu'];		
	     var saveLayoutItem = {	          
	          name: 'Save Layout',	
	          action: function() {	        	 
	               params.context.componentParent.executeFunctionCall('saveLayout', 'myLayout');
	          }
	     };		
	     generalMenuItems.push(saveLayoutItem);		
	     return generalMenuItems;	
	}
	elements.datagrid_2.addFunctionCall('saveLayout', saveLayout);
	elements.datagrid_2.gridOptions = { "getMainMenuItems": application.generateBrowserFunction(String(f)) };
}
```

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} alias Name used in params.context.componentParent.executeFunctionCall to call the function
> * {[Function](/reference/servoy-developer/component_and_service_property_types.md#function)} f The Servoy solution function

***

### autoSizeAllColumns()

Auto-sizes all columns based on content.

***

### editCellAt(foundsetindex,columnindex)

Start cell editing (only works when the table is not in grouping mode).

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} foundsetindex Foundset row index of the editing cell (1-based)
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} columnindex Column index in the model of the editing cell (0-based)

***

### getCheckboxGroupSelection()

Returns the selected headers or groups in the table when the headerCheckbox or groupCheckbox property is used.\
The returned value is an array of objects, where each object represents a selected group or header.\
Each object includes a \`colId\` representing the column identifier and, for groups, a \`groupkey\` representing the group key.\
For headers, the \`groupkey\` property is not included.

**Example:**

```js
// Example of returned data
[
    { colId: 'country', groupkey: 'USA' },   // Group selection
    { colId: 'region' }                      // Header selection
]
```

**Returns:** [Array\<Object>](/reference/servoycore/dev-api/js-lib/object.md) The selected headers or groups. Each object has the following structure: - \`colId\` (String): The identifier of the column. - \`groupkey\` (String, optional): The key of the group (not included for headers).

***

### getColumn(index)

Gets the column at index. Index is 0 based.

**Example:**

```js
    elements.myElement.getColumn()
```

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index Index between 0 and columns length -1

**Returns:** [CustomType\<aggrid-groupingtable.column>](#column) The column object at the specified index.

***

### getColumnById(colId)

Gets the column with id colId

**Example:**

```js
    elements.myElement.getColumnById('myid')
```

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} colId Id of the column

**Returns:** [CustomType\<aggrid-groupingtable.column>](#column) The column object corresponding to the provided id.

***

### getColumnIndex(colId)

Return the column index for the given column id.\
Can be used in combination with getColumnState to retrieve the column index for the column state with colId in the columnState object.

**Example:**

```js
// get the state
var state = elements.table.getColumnState();
// parse the state of each column
var columnsState = JSON.parse(state).columnState;

for (var index = 0; index < columnsState.length; index++) {

  // skip column hidden by the user
  if (!columnsState[index].hide) {

   // get the column using the colId of the columnState
   var columnIndex = elements.table.getColumnIndex(columnsState[index].colId);
     if (columnIndex > -1) {
       var column = elements.table.getColumn(columnIndex);
       // do something with column               
     }
 }
}
```

**@public**

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} colId The unique identifier of the column whose index is to be retrieved.

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The 0-based index of the column corresponding to the given column id, or -1 if the column id is not found.

***

### getColumnState()

Returns the current state of the columns (width, position, grouping state) as a json string that can be used to restore to this state using restoreColumnState

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The current state of the columns as a JSON string for restoring the state.

***

### getColumnsCount()

Gets the number of columns

**Example:**

```js
    elements.myElement.getColumnsCount()
```

**Returns:** [Number](/reference/servoycore/dev-api/js-lib/number.md) The total number of columns in the specified element.

***

### getColumnsFromState(columnState)

Returns the columns from the columnState string, if specified, or from the current columnState

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[columnState] The column state to use, if not set the grid's current column state is used.

**Returns:** [Array\<CustomType\<aggrid-groupingtable.columnStateColumn>>](#columnstatecolumn) The columns in the state.

***

### getExpandedGroups()

Returns currently expanded groups as an object like:\
{expandedGroupName1:{}, expandedGroupName2:{expandedSubGroupName2\_1:{}, expandedSubGroupName2\_2:{}}}

**Returns:** [Object](/reference/servoycore/dev-api/js-lib/object.md) An object representing the currently expanded groups, where each key is a group name, and its value is an object detailing any expanded subgroups.

***

### getGroupedSelection()

Returns the selected rows when in grouping mode

**Returns:** [Array\<JSRecord>](/reference/servoycore/dev-api/database-manager/jsrecord.md) An array of JSRecord objects representing the selected rows in grouping mode.

***

### getViewColumnById(colId)

Returns the view column corresponding to the given column ID.

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} colId - The unique identifier of the column.

**Returns:** [CustomType\<aggrid-groupingtable.viewColumn>](#viewcolumn) The view column object corresponding to the specified column ID.

***

### getViewColumns()

Returns an array of view columns currently visible in the grid.

**Returns:** [Array\<CustomType\<aggrid-groupingtable.viewColumn>>](#viewcolumn) An array of view column objects representing the columns currently displayed.

***

### isToolPanelShowing()

Returns true if the ToolPanel is showing

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) \`true\` if the ToolPanel is showing otherwise \`false\`

***

### moveColumn(id,index)

Move column

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} id Column id
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index New position (0-based)

***

### newColumn(dataprovider,index)

Adds new column at specified index. Index is 0 based.

**Example:**

```js
    var column = elements.myElement.newColumn('dataproviderid')
```

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} dataprovider Dataprovider of the column
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[index] Index between 0 and columns length

**Returns:** [CustomType\<aggrid-groupingtable.column>](#column) The newly created column object at the specified index with the given dataprovider.

***

### notifyDataChange()

Notify the component about a data change. Makes the component aware of a data change that requires a refresh data.

Call this method when you are aware of a relevant data change in the foundset which may affect data grouping (e.g. group node created or removed).\
The component will alert the user of the data change and it will suggest to the user to perform a refresh.

Please note that it’s not necessary to notify the table component if the component is not visible; the component will always present the latest data when rendered again.

**@public**

***

### refreshData()

Force a full refresh of the data.

**WARNING !** be aware that calling this API results in bad user experience since all group nodes will be collapsed instantaneously.

**@public**

***

### removeAllColumns()

Removes all columns.

**Example:**

```js
    elements.myElement.removeAllColumns()
```

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if all columns were successfully removed; otherwise, false.

***

### removeColumn(index)

Removes column from specified index. Index is 0 based.

**Example:**

```js
    elements.myElement.removeColumn(0)
```

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index Index between 0 and columns length -1

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if the column was successfully removed, false otherwise.

***

### requestFocus(columnindex)

Request focus on the given column

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} columnindex Column index in the model of the editing cell (0-based)

***

### restoreColumnState(columnState,onError,columns,filter,sort)

Restore columns state to a previously save one, using getColumnState.

If no argument is used, it restores the columns to designe time state.\
If the columns from columnState does not match with the columns of the component, no restore will be done.

The optional boolean arguments: columns, filter, sort can be used to specify what to restore:\
\- the columns size/position/visibility (default true),\
\- the filter state (default false),\
\- the sort state (default false).

**Parameters:**

> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[columnState] A JSON string representing the saved state of the columns, including width, position, visibility, filters, and sorting. If omitted, the columns will be restored to their design-time state.
> * {[Function](/reference/servoy-developer/component_and_service_property_types.md#function)} \[onError] A callback function to handle errors during the restore process, such as mismatched column configurations.
> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[columns] Specifies whether to restore the columns' size, position, and visibility. Defaults to true.
> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[filter] Specifies whether to restore the columns' filter state. Defaults to false.
> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[sort] Specifies whether to restore the columns' sort state. Defaults to false.

***

### scrollToSelection()

Scroll to the selected row

***

### setCheckboxGroupSelection(groups)

Sets the selected headers or groups in the table when the headerCheckbox or groupCheckbox property is used.\
The input should be an array of objects where each object represents a selected group or header.\
The objects should have a \`colId\` representing the column identifier, and optionally a \`groupkey\`\
representing the key of the group. For headers, the \`groupkey\` should not be included.

**Example:**

```js
// Example of selecting groups
const selectedGroups = [
    { colId: 'country', groupkey: 'USA' },
    { colId: 'country', groupkey: 'Canada' }
];
elements.myTable.setCheckboxGroupSelection(selectedGroups);
```

**Example:**

```js
// Example of selecting headers
const selectedHeaders = [
    { colId: 'country' },
    { colId: 'region' }
];
elements.myTable.setCheckboxGroupSelection(selectedHeaders);
```

**Parameters:**

> * {[Array\<Object>](/reference/servoycore/dev-api/js-lib/object.md)} groups The selected headers or groups. Each object should have the following structure: - \`colId\` (String): The identifier of the column. - \`groupkey\` (String, optional): The key of the group (not included for headers).

***

### setColumnsToState(columns,columnState)

Sets the columns to the columnState string, if specified, or to the current columnState

**Parameters:**

> * {[Array\<CustomType\<aggrid-groupingtable.columnStateColumn>>](#columnstatecolumn)} columns Columns to update.
> * {[String](/reference/servoycore/dev-api/js-lib/string.md)} \[columnState] The column state to update, if not set the grid's current column state is used.

**Returns:** [String](/reference/servoycore/dev-api/js-lib/string.md) The updated columns state.

***

### setExpandedGroups(groups)

Sets expanded groups

**Parameters:**

> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} groups An object like {expandedGroupName1:{}, expandedGroupName2:{expandedSubGroupName2\_1:{}, expandedSubGroupName2\_2:{}}}

***

### setFilterModel(filterModel)

Set the filter model.\
This api maps to ag-grid's setFilterModel; for more details on the model's structure check this page: <https://www.ag-grid.com/angular-data-grid/filter-api/\\>
To clear the filter, use an empty object ({}) as filterModel;

NOTE: The name of the columns from the model are the id properties of the column.

**Example:**

```js
	var filterModel = {
		"country": {
			"filterType":"text",
			"type":"contains",
			"filter":"Argentina"
		}
	};
	
	var filterModelWithCondition = {
		"freight": {
			"filterType":"number",
			"operator":"OR",
			"condition1": { 
				"filterType":"number",
				"type":"equals",
				"filter":66
			},
			"condition2": {
				"filterType":"number",
				"type":"equals",
				"filter":23
			}
		}
	};
	
	elements.groupingtable_1.setFilterModel(filterModelWithCondition);
	
	//clear filter
	//elements.groupingtable_1.setFilterModel({});
```

**@public**

**Parameters:**

> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} filterModel The filter model object defining the filtering criteria for the grid. Each key represents a column's id, and its value specifies the filter configuration, including filter type, conditions, and operator. To clear all filters, pass an empty object ({} ).

***

### setFormEditorValue(value)

Set the currently opened form editor value

**Parameters:**

> * {[Object](/reference/servoycore/dev-api/js-lib/object.md)} value Form editor value

***

### setGroupedSelection(selectedRecords)

Set the selection in grouping mode 111. The table must be already in grouping mode, and the record already loaded (the group of the record expanded - see: setExpandedGroups)

**Parameters:**

> * {[Array\<JSRecord>](/reference/servoycore/dev-api/database-manager/jsrecord.md)} selectedRecords Form editor value

***

### setReadOnly(readonly,columnids)

Set the table read-only state. If no columnids is used, all columns read-only state is set, otherwise only for the columns specified.

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} readonly Read-only state
> * {[Array\<String>](/reference/servoycore/dev-api/js-lib/string.md)} \[columnids] Array of column ids to make ready-only

***

### showToolPanel(show)

Show or hide the ToolPanel

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} show A flag indicating whether to show (true) or hide (false) the ToolPanel in the Servoy component.

***

### sizeColumnsToFit()

Adjusts the columns' widths to fit the available viewport, ensuring that all visible columns are resized to fill the table's width.\
This method dynamically resizes columns to ensure no empty space remains in the grid's horizontal viewport.

**Example:**

```js
elements.myTable.sizeColumnsToFit();
```

***

### stopCellEditing(cancel)

If a cell is editing, it stops the editing

**Parameters:**

> * {[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)} \[cancel] 'true' to cancel the editing (ie don't accept changes)

***

## Types

## JSDNDEvent

Drag and drop event type scripting type: CustomType\<aggrid-groupingtable.JSDNDEvent>

extends: [JSEvent](#jsevent)

* sourceColumnId
  * Drag source column id.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* sourceGridName
  * Name of the grid that with the drag source.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* targetColumnId
  * Drop target column id.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)

## column

Type definition for a grid column. scripting type: CustomType\<aggrid-groupingtable.column>

* autoResize
  * Enables auto-resizing for the column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* columnDef
  * Map where additional column properties of ag-grid can be set
  * **Type**: [json](/reference/servoycore/dev-api/js-lib/json.md)
* dataprovider
  * Data provider identifier for the column.
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* dndSource
  * Allow dragging
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* dndSourceDataprovider
  * Boolean dataprovider for allow/disallow dragging.
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* editForm
  * Form used as custom editor
  * **Type**: [form](/reference/servoy-developer/component_and_service_property_types.md#form)
* editFormSize
  * Size configuration for the custom editor form.
  * **Type**: [dimension](https://github.com/Servoy/gitbook/blob/master/reference/servoycore/dev-api/js-lib/dimension.md)
  * **Default Value**: {"width":300,"height":200}
* editType
  * Type of editing used for that column
  * **Type**: [modifiable](/reference/servoy-developer/component_and_service_property_types.md#modifiable)
* enableResize
  * Allows resizing of the column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* enableRowGroup
  * Allow the user to group or ungroup the column
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* enableSort
  * Allows sorting on this column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* enableToolPanel
  * If the column should be visible in the tool panel
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* enabled
  * Flag indicating if the column is enabled.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* excluded
  * When true the column is excluded from the UI
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* filterType
  * Filter type to be used for this column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* footerStyleClass
  * CSS class for the column footer.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* footerText
  * Footer text to display in the column.
  * **Type**: [tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)
* footerTextShowAs
  * Defines how the footer text is rendered (e.g., inline, tooltip).
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* format
  * Format pattern for the column's data.
  * **Type**: [format](/reference/servoy-developer/component_and_service_property_types.md#format)
* headerCheckbox
  * When true the column has checkbox for selecting/unselecting all rows
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* headerGroup
  * Header group, that this column will be part of
  * **Type**: [tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)
* headerGroupStyleClass
  * CSS class for the header group.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* headerIconStyleClass
  * (Font awesome) Styles for header icon
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* headerStyleClass
  * CSS class for the column header.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* headerTitle
  * If the column has a database linked dataprovider, the default value of the headerTitle is the title text of the database column or if that is not set, the database column name.
  * **Type**: [titlestring](/reference/servoy-developer/component_and_service_property_types.md#titlestring)
* headerTooltip
  * Tooltip text for the header.
  * **Type**: [tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)
* id
  * Used to set the column id (colId) property in the serialized column state json string of getColumnState and onColumnStateChanged
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* isEditableDataprovider
  * Use a Servoy calculation as isEditableDataprovider to set edit state conditionally to the table cell
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* maxWidth
  * Maximum width in pixels.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* minWidth
  * Minimum width in pixels.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* rowGroupIndex
  * Set the rowGroupIndex to group on the column; the index defines the order of the group when there are multiple grouped columns
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
  * **Default Value**: -1
* showAs
  * Defines an alternative display mode for the column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* stopEditingOnChange
  * When true, editing stops on change.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* styleClass
  * CSS class for the cell.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* styleClassDataprovider
  * Use a Servoy calculation as styleClassDataprovider to set styleClass conditionally to the table cell
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* tooltip
  * Tooltip text for the cell.
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* valuelist
  * Value list used to map column values.
  * **Type**: [valuelist](/reference/servoy-developer/component_and_service_property_types.md#valuelist)
* valuelistConfig
  * Configuration for the value list.
  * **Type**: [valuelistConfig](/reference/servoy-developer/component_and_service_property_types.md#valuelistConfig)
* visible
  * Visibility state of the column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* width
  * Column width in pixels.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
  * **Default Value**: 0

## columnStateColumn

Column object used by the grid api for manipulating saved grid states. scripting type: CustomType\<aggrid-groupingtable.columnStateColumn>

* aggFunc
  * The aggregation function applied.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* colId
  * Id of the column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* flex
  * Column's flex if flex is set.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* hide
  * True if the column is hidden.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
* pinned
  * Set if column is pinned.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* pivot
  * True if pivot active.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
* pivotIndex
  * The order of the pivot, if pivoting by many columns.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* rowGroup
  * True if row group active.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
* rowGroupIndex
  * The order of the row group, if grouping by many columns.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* sort
  * Sort applied to the column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* sortIndex
  * The order of the sort, if sorting by many columns.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* width
  * Width of the column in pixels.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)

## columnsAutoSizingOn

Events that trigger auto-sizing of columns. scripting type: CustomType\<aggrid-groupingtable.columnsAutoSizingOn>

* columnResize
  * Apply 'columnsAutoSizing' when columns are resized
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* columnRowGroupChange
  * Apply 'columnsAutoSizing' when row grouping is changed
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* displayedColumnsChange
  * Apply 'columnsAutoSizing' when columns are added/removed
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* gridReady
  * Apply 'columnsAutoSizing' when grid is ready to be shown
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* gridSizeChange
  * Apply 'columnsAutoSizing' when grid size changes
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* toolPanelVisibleChange
  * Apply 'columnsAutoSizing' when the toolpanel visibility is changed
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true

## functionCall

Definition for a Servoy solution function call. scripting type: CustomType\<aggrid-groupingtable.functionCall>

* alias
  * Alias for the function call.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* f
  * The function reference to execute.
  * **Type**: [function](/reference/servoy-developer/component_and_service_property_types.md#function)

## gridConfig

Grid configuration options. scripting type: CustomType\<aggrid-groupingtable.gridConfig>

* enableColResize
  * Enables column resizing.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* enableSorting
  * Enables column sorting.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* groupUseEntireRow
  * When true, group rows span the entire row.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true

## groupedColumn

Type definition for a grouped column. scripting type: CustomType\<aggrid-groupingtable.groupedColumn>

* columnid
  * Original column identifier associated with this group.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* dataprovider
  * Data provider for the grouped column.
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* format
  * Format pattern for the grouped column.
  * **Type**: [format](/reference/servoy-developer/component_and_service_property_types.md#format)
* id
  * Unique identifier for the grouped column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* styleClassDataprovider
  * Calculation to conditionally set CSS classes for the group.
  * **Type**: [dataprovider](/reference/servoy-developer/component_and_service_property_types.md#dataprovider)
* valuelist
  * Value list for mapping grouped column data.
  * **Type**: [valuelist](/reference/servoy-developer/component_and_service_property_types.md#valuelist)

## hashedFoundset

Type definition for a hashed foundset. scripting type: CustomType\<aggrid-groupingtable.hashedFoundset>

* columns
  * Column configuration for the foundset.
  * **Type**: [groupedColumn\[\]](#groupedcolumn)
* foundset
  * The foundset object reference.
  * **Type**: [foundset](/reference/servoycore/dev-api/database-manager/jsfoundset.md)
* foundsetUUID
  * Unique identifier for the foundset.
  * **Type**: [foundsetRef](/reference/servoy-developer/component_and_service_property_types.md#foundsetref)
* uuid
  * Unique hash identifier.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)

## iconConfig

Icon configuration for various grid features. scripting type: CustomType\<aggrid-groupingtable.iconConfig>

* iconCheckboxChecked
  * Icon for a checked checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconCheckboxCheckedReadOnly
  * Icon for a read-only checked checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconCheckboxIndeterminate
  * Icon for an indeterminate checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconCheckboxIndeterminateReadOnly
  * Icon for a read-only indeterminate checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconCheckboxUnchecked
  * Icon for an unchecked checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconCheckboxUncheckedReadOnly
  * Icon for a read-only unchecked checkbox.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconClipboardCopy
  * Icon for copying to the clipboard.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconClipboardPaste
  * Icon for pasting from the clipboard.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnGroupClosed
  * Icon for a closed column group.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnGroupOpened
  * Icon for an open column group.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveAdd
  * Icon for adding a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveGroup
  * Icon for grouping a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveHide
  * Icon for hiding a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveLeft
  * Icon for moving a column to the left.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveMove
  * Icon for moving a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMovePin
  * Icon for pinning a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMovePivot
  * Icon for pivoting a column.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveRight
  * Icon for moving a column to the right.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnMoveValue
  * Icon for moving a column's value.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnSelectClosed
  * Icon for closed column selection.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumnSelectOpen
  * Icon for open column selection.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconColumns
  * Icon for the columns panel.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconDropNotAllowed
  * Icon indicating drop is not allowed.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconEditorChecked
  * Icon for a checked editor state.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconEditorUnchecked
  * Icon for an unchecked editor state.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconFilter
  * Icon for filtering.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconGroupContracted
  * Icon indicating a contracted group.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconGroupExpanded
  * Icon indicating an expanded group.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconMenu
  * Icon for the menu.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconMenuAddRowGroup
  * Icon for adding a row group via the menu.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconMenuPin
  * Icon for pinning in the header menu.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconMenuRemoveRowGroup
  * Icon for removing a row group via the menu.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconMenuValue
  * Icon for displaying values in the header menu.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconPivotPanel
  * Icon for the pivot panel.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconRefreshData
  * Icon for refreshing data.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconRowGroupPanel
  * Icon for the row group panel.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconSortAscending
  * Icon for ascending sort.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconSortDescending
  * Icon for descending sort.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconSortUnSort
  * Icon for unsorted state.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)
* iconValuePanel
  * Icon for the value panel.
  * **Type**: [styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)

## mainMenuItemsConfig

Configuration options for main menu items. scripting type: CustomType\<aggrid-groupingtable.mainMenuItemsConfig>

* autoSizeAll
  * Option to auto-size all columns.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* autoSizeThis
  * Option to auto-size the current column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* columnChooser
  * Option to show the column chooser.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* columnFilter
  * Option to show the column filter.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* contractAll
  * Option to collapse all groups in the grid.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* expandAll
  * Option to expand all groups in the grid.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* pinSubMenu
  * Configuration for the pin sub-menu.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* resetColumns
  * Option to reset columns to their default state.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* rowGroup
  * Option to group rows by this column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* rowUnGroup
  * Option to ungroup rows.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: true
* sortAscending
  * Option to sort the column in ascending order.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* sortDescending
  * Option to sort the column in descending order.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* sortUnSort
  * Option to clear the sort on the column.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* valueAggSubMenu
  * Configuration for the value aggregation sub-menu.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false

## toolPanelConfig

Configuration options for the ag‑grid tool panel. scripting type: CustomType\<aggrid-groupingtable.toolPanelConfig>

* suppressColumnExpandAll
  * Suppress the "expand all" option in the tool panel.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* suppressColumnFilter
  * Suppress the column filter in the tool panel.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* suppressColumnSelectAll
  * Suppress the "select all" option in the tool panel.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* suppressRowGroups
  * Suppress row groups in the tool panel.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* suppressSideButtons
  * Suppress side buttons in the tool panel.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false

## viewColumn

Type definition for a view column. scripting type: CustomType\<aggrid-groupingtable.viewColumn>

* colId
  * Unique identifier for the view column.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* hide
  * When true, the column is hidden.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
* rowGroup
  * Indicates if the column is used for grouping.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
* rowGroupIndex
  * Grouping order index.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* sort
  * Sorting order (e.g., asc, desc).
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* sortIndex
  * Index for multi-column sorting.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)
* width
  * Width of the view column.
  * **Type**: [int](/reference/servoycore/dev-api/js-lib/number.md)

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/ui-components/grids/data-grid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
