Table

(part of package 'Servoy Extra Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

This is a reference page; many components have detailed usage guides here.

Properties

columns

Type: column[]


currentPage

Type: int Default Value: 1


enableColumnResize

Type: boolean Default Value: false


enableMobileView

Type: boolean


enableSort

Type: boolean Default Value: true


foundset

Type: foundset Default Value: {"foundsetSelector":""}


horizontalScrollbar

By default horizontal scrollbar is shown as needed. Setting to NEVER will always hide it.

Type: string


keyCodeSettings

Enable/Disable key bindings.

Type: keyCodeSettings


minRowHeight

Type: string Default Value: "25px"


pageSize

Number of rows per page, 0 means infinite scrolling mode.

Type: foundsetInitialPageSize Default Value: 20


performanceSettings

Settings for incremental scrolling, see github wiki for more details.

Type: settings


responsiveDynamicHeight

When is set, the height is defined by the number of rows; if the calculated height exceeds 'responsiveHeight', then the later will be used as height.

Type: boolean Default Value: false


responsiveHeight

Height of the table, set only in responsive forms.

Type: int Default Value: 300


rowStyleClassDataprovider

Type: dataprovider


selectionClass

Type: styleclass Default Value: "table-servoyextra-selected "


sortColumnIndex

Type: int Default Value: -1


sortDirection

Type: string


sortStyleClass

Type: styleclass Default Value: "selected-column "


sortdownClass

Type: styleclass Default Value: "table-servoyextra-sort-down "


sortupClass

Type: styleclass Default Value: "table-servoyextra-sort-up "


styleClass

Type: styleclass Default Value: "table"


tabSeq

Type: tabseq


visible

Type: visible


Events

onCellClick(foundsetindex,columnindex,record,event,columnid)

Called when the mouse is clicked on a row/cell (foundset and column indexes are given) or when the ENTER key is used (then only the selected foundset index is given). Use the record to exactly match what the user clicked on.

Parameters:


onCellDoubleClick(foundsetindex,columnindex,record,event,columnid)

Called when the mouse is double clicked on a row/cell (foundset and column indexes are given)

Parameters:


onCellRightClick(foundsetindex,columnindex,record,event,columnid)

Called when the right mouse button is clicked on a row/cell (foundset and column indexes are given). Use the record to exactly match what the user clicked on.

Parameters:


onColumnResize(event)

Parameters:


onFocusGainedMethodID(event)

Parameters:


onFocusLostMethodID(event)

Parameters:


onHeaderClick(columnindex,sortdirection,event,columnid)

@return {string}

Parameters:

Returns: {string}


onHeaderRightClick(columnindex,sortdirection,event,columnid)

@return {string}

Parameters:

Returns: {string}


onViewPortChanged(start,end)

Parameters:


API

getColumn(index)

Gets the column at index. Index is 0 based.

Example:

	myElement.getColumn()

Parameters:

  • {int} index ** index index between 0 and columns length -1

Returns: column


getColumnsCount()

Gets the number of columns

Example:

	myElement.getColumnsCount()

Returns: int


getSortClass(columnIndex)

@return {string}

Parameters:

  • {int} columnIndex

Returns: string


getViewPortPosition()

@return {object}

Returns: object


newColumn(dataprovider,index)

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

Example:

	var column = myElement.newColumn('dataproviderid')

Parameters:

  • {string} dataprovider ** dataproviderid dataprovider of the column

  • {int} [index] ** index index between 0 and columns length

Returns: column


removeAllColumns()

Removes all columns.

Example:

myElement.removeAllColumns()

Returns: boolean


removeColumn(index)

Removes column from specified index. Index is 0 based.

Example:

myElement.removeColumn(0)

Parameters:

  • {int} index ** index index between 0 and columns length -1

Returns: boolean


requestFocus(mustExecuteOnFocusGainedMethod)

Request the focus to the table html element.

Example:

myElement.requestFocus();

Parameters:

  • {boolean} [mustExecuteOnFocusGainedMethod] ** mustExecuteOnFocusGainedMethod (optional) if false will not execute the onFocusGained method; the default value is true


setSelectedHeader(columnIndex)

Parameters:

  • {int} columnIndex


Types

column

scripting type: CustomType<servoyextra-table.column>

keyCodeSettings

scripting type: CustomType<servoyextra-table.keyCodeSettings>

  • arrowDown

  • arrowUp

  • end

  • enter

  • home

  • pageDown

  • pageUp

settings

scripting type: CustomType<servoyextra-table.settings>

  • fastScrollLoadThresholdFactor

    • Type: int

    • Default Value: 2.3

  • fastScrollRenderThresholdFactor

    • Type: int

    • Default Value: 3

  • maxLoadedRows

    • Type: int

    • Default Value: 1000

  • maxRenderedRows

    • Type: int

    • Default Value: 450

  • minBatchSizeForLoadingMoreRows

    • Type: int

    • Default Value: 20

  • minBatchSizeForRenderingMoreRows

    • Type: int

    • Default Value: 10


Last updated