API calls for the flat table

Learn more about available API calls for the flat table control.

clearSort

clearSort(fieldName: String): Promise<void>

Clears the applied sorting from a specified field or all fields at once.

Parameters

Parameter/TypeDescription
fieldNameStringClears the applied sorting from the sorted field. If the fieldName is not specified, sorting will be cleared from all fields.

Example

flatTable.clearSort("Score").then(()=>{
  // Your functionality
});

Returns: Promise<void> - A Promise that resolves to undefined. It is useful when working with server-side data sources to perform operations over the data asynchronously. The Promise ensures that code depending on the result of clearSort() is run after the operation is fully completed.

getCell

getCell(rowIdx: Number, colIdx: Number): GridCellObject

Gets the cell object at the specified row and column coordinates.

Parameters

Parameter/TypeDescription
rowIdxNumberThe index of the row.
colIdxNumberThe index of the column.

Example

flatTable.getCell(1, 2);

Returns: GridCellObject, which contains information about the cell.

scrollToColumn

scrollToColumn(columnIndex: Number)

Scrolls the grid to the specified column.

Parameters

Parameter/TypeDescription
columnIndexNumberThe index of the column to which the grid will be scrolled. Indexes start from 0.

Example:

flexmonster.scrollToColumn(5);

scrollToRow

scrollToRow(rowIndex: Number)

Scrolls the grid to the specified row.

Parameters

Parameter/TypeDescription
rowIndexNumberThe index of the row to which the grid will be scrolled. Indexes start from 0.

Example:

flexmonster.scrollToRow(5);

setSort

clearSort(sortParams: Object): Promise<void>

Sorts the field members in the specified order.

Parameters

Parameters/TypeDescription
sortParamsObjectDescribes the sorting configs.
sortParams.fieldNameStringUnique name of the field whose members will be sorted.
sortParams.sortOrderStringThe sorting type. Possible values: "asc", "desc", or "unsorted".

Example

flatTable.setSort({
  fieldName: "Score",
  sortDirection: "desc"
}).then(()=>{
  // Your functionality
});

Returns: Promise<void> - A Promise that resolves to undefined. It is useful when working with server-side data sources to perform operations over the data asynchronously. The Promise ensures that code depending on the result of setSort() is run after the operation is fully completed.