Zum Hauptinhalt springen

MultiTableOptionsHelper

Constructors​

Constructor​

new MultiTableOptionsHelper(): MultiTableOptionsHelper

Returns​

MultiTableOptionsHelper

Properties​

FUNCTION_PREFIX​

static FUNCTION_PREFIX: string

Methods​

getColumnAttributeCallbackHandler()​

static getColumnAttributeCallbackHandler<ReturnType>(callbackOrFunctionName): ColumnAttributeCallback<ReturnType>

Helper function: returns the column attribute as a function.

Type Parameters​

ReturnType​

ReturnType

Parameters​

callbackOrFunctionName​

ColumnAttributeCallbackHandler<ReturnType>

Returns​

ColumnAttributeCallback<ReturnType>


triggerColumnCallback()​

static triggerColumnCallback<ReturnType>(options, columnName, key, row?, defaultValue?): string | ReturnType

Triggers the callback.

Type Parameters​

ReturnType​

ReturnType

Parameters​

options​

MultiTableOptions

columnName​

string

key​

"type" | "allowEdit" | "allowInsert" | "reorderable" | "resizable" | "visible" | "label" | "tooltip" | "field" | "sortable" | "defaultValue" | "required" | "validation" | "attributes" | "selectOnFocus" | "change" | "headerTemplate" | "footerTemplate" | "width" | "render" | "disableInternationalization" | "cellBackgroundColor"

row?​

MultiTableRow

defaultValue?​

ReturnType

Returns​

string | ReturnType


triggerCallback()​

static triggerCallback<ReturnType>(callbackOrFunctionName, options, column?, row?, defaultValue?): string | ReturnType

Triggers a callback or function and returns the result

Type Parameters​

ReturnType​

ReturnType

Parameters​

callbackOrFunctionName​

ColumnAttributeCallbackHandler<ReturnType>

The callback or function name

options​

MultiTableOptions

The MultiTableOptions

column?​

MultiTableColumn

The MultiTableColumn

row?​

MultiTableRow

The MultiTableRow

defaultValue?​

ReturnType

The default value

Returns​

string | ReturnType

The result of the callback or function


getLocaleValue()​

static getLocaleValue(text, language?): string

Returns a localed value from a string (see https://otris.software/documents/api/portalscript/context.html#getLocaleValue)

Parameters​

text​

string

The value/label string like "de:Deutsch; en:English"

language?​

string

Optional String with the locale (like "de"); if omitted, the options.language will be used or the current user's portal language.

Returns​

string

The string in appropriate language.


stringify()​

static stringify(options): string

Converts a MultiTableOptions object into a JSON string.

Parameters​

options​

object | MultiTableOptions

Returns​

string


getColumnTypeFromDBResultType()​

static getColumnTypeFromDBResultType(dbType): MultiTableColumnTypes

Returns the column type based on the DBResultType

Parameters​

dbType​

DBResultType

The DBResultType

Returns​

MultiTableColumnTypes

The MultiTableColumnTypes


getOptionsFromDatabase()​

static getOptionsFromDatabase(query): Pick<MultiTableOptions, "columns" | "rows">

Returns a object providing columns and rows from a given SelectBuilder. It uses the columns alias or name as label and the type from the given type. If no columns are defined, it will use the first row to generate the columns.

Parameters​

query​

SelectBuilder

a SelectBuilder instance to get the rows and columns from

Returns​

Pick<MultiTableOptions, "columns" | "rows">

The columns and rows