MultiTableColumnSelect
Most properties can be given either as a fixed value or as a callback function. The callback must
return the same type as the fixed value; returning nothing (return;) falls back to the default.
Callbacks are executed client-side! Only documentsContext is available there.
The row passed into a callback must not be modified! Doing so can lead to inconsistent data.
Extends
Properties
type?
optionaltype:ColumnAttributeCallbackHandler<"select">
(Optional) Column's display type.
Default
"default"
Example
type: "currency"
Overrides
entries?
optionalentries:object[] |ColumnAttributeCallbackHandler<string[] |object[]>
(Optional) Entries for the select list.
See
https://otris.software/documents/manuals/books/autotexte/Enum.html
Default
[]
Examples
entries: [
{ text: "de:Erfasst;en:Created", value: "10" },
{ text: "de:Fertig;en:Done", value: "100" }
]
entries: ["1;de:Eins;en:One", "2;de:Zwei;en:Two"]
entries: context.getEnumAutoText("%loginFullname%")
entries: (options) => {
const fileContext = documentsContext.getFileContext();
if (fileContext.getFileFieldValue("state") === "unauthorized") {
return []
}
return [
{ text: "Entry 1", value: 1 },
{ text: "Entry 2", value: 2 },
{ text: "Entry 3", value: 3 }
]
}
onlyShowUnusedEntries?
optionalonlyShowUnusedEntries:boolean
(Optional) Should the selection be limited to entries not yet used elsewhere in the table?
label
label:
ColumnAttributeCallbackHandler<string>
Column header.
Default
""
Examples
label: "de:Netto;en:net"
label: (options) => "Rows: " + options.rows.length
Inherited from
tooltip?
optionaltooltip:ColumnAttributeCallbackHandler<string>
(Optional) Column tooltip.
Inherited from
visible?
optionalvisible:ColumnAttributeCallbackHandler<boolean>
(Optional) Should the column be shown?
Inherited from
field?
optionalfield:string
(Optional) Name of the file field to map to. If no mapping is wanted, the value must be empty (field: "").
Inherited from
allowEdit?
optionalallowEdit:ColumnAttributeCallbackHandler<boolean>
(Optional) May the column be edited in edit mode?
Default
true
Example
allowEdit: (options) => options.row.vendorId != ""
Inherited from
allowInsert?
optionalallowInsert:ColumnAttributeCallbackHandler<boolean>
(Optional) Can a value be entered when inserting a row?
Default
true
Example
allowInsert: (options) => options.rows.length <= 0
Inherited from
sortable?
optionalsortable:ColumnAttributeCallbackHandler<boolean>
(Optional) Is the column sortable?
Inherited from
reorderable?
optionalreorderable:ColumnAttributeCallbackHandler<boolean>
(Optional) Can this column be reordered via drag & drop? Defaults to true if options.reorderable
is set, otherwise false. options.reorderable: false disables reordering for all columns.
Description
Only for MultiTableReact
Examples
reorderable: false
reorderable: (options) => options.rows.length > 0
Inherited from
resizable?
optionalresizable:ColumnAttributeCallbackHandler<boolean>
(Optional) Can this column's width be resized via drag & drop? Defaults to true if
options.resizable is set, otherwise false. options.resizable: false disables resizing for
all columns.
Description
Only for MultiTableReact
Examples
resizable: true
resizable: (options) => options.rows.length > 0
Inherited from
defaultValue?
optionaldefaultValue:unknown
(Optional) Predefined value when creating a new row.
Inherited from
IMultiTableColumn.defaultValue
required?
optionalrequired:ColumnAttributeCallbackHandler<boolean>
(Optional) Required field when creating a new row?
Inherited from
validation?
optionalvalidation:CellColumnAttributeCallbackHandler<boolean>
(Optional) Custom validation. The callback receives the cell value as its first and the ColumnAttributeCallbackOptions as its second parameter.
Default
null
Examples
validation: "someGlobalValidationFunction"
validation: (cellValue) => cellValue > 0 // 0 is a valid value too, so it must be strictly greater
Inherited from
attributes?
optionalattributes:Record<string,CellColumnAttributeCallbackHandler<unknown>>
(Optional) Additional field attributes. Each attribute can be a fixed value or a callback that receives the cell value as its first and the ColumnAttributeCallbackOptions as its second parameter.
Default
null
Examples
attributes: {
class: 'some-class',
title: 'A tooltip'
}
attributes: {
class: "text-right",
style: (value) => "color: " + (value > 1000 ? "#f00" : "inherit")
}
Inherited from
selectOnFocus?
optionalselectOnFocus:boolean
(Optional) Should the text in the input field be selected when it receives focus?
For type: "textarea" it can be useful to set this to false so the entire text isn't selected.
Default
true
Inherited from
IMultiTableColumn.selectOnFocus
change?
optionalchange:ChangeCallbackHandler
(Optional) Callback invoked when the value has changed.
Examples
// Named global function
change: "someCallbackFunction"
change: (amount, options) => {
if (amount < 0) {
return 0
}
}
change: (value, options) => {
const total = value * options.row.get("taxRate") / 100
options.row.set("totalAmount", total.toFixed(2))
options.row.focus("taxRate")
}
Inherited from
headerTemplate?
optionalheaderTemplate:ColumnAttributeCallbackHandler<string>
(Optional) HTML for the header area.
Example
// Provided as string
headerTemplate: "Additional column heading"
// callback script
headerTemplate: (options) => {
const sum = options.rows.reduce((acc, row) => acc + row.amount, 0)
return "<div style='text-align:right; border-top: solid 2px #000; border-bottom: double 3px #000; margin: -4px; padding-right: 4px'>" + sum + " €</div>"
}
Inherited from
IMultiTableColumn.headerTemplate
footerTemplate?
optionalfooterTemplate:ColumnAttributeCallbackHandler<string>
(Optional) HTML for the footer area.
Example
// Provided as string
footerTemplate: "Additional footer info"
// callback script
footerTemplate: (options) => {
const sum = options.rows.reduce((acc, row) => acc + row.amount, 0)
return "<div style='text-align:right; border-top: solid 2px #000; border-bottom: double 3px #000; margin: -4px; padding-right: 4px'>" + sum + " €</div>"
}
Inherited from
IMultiTableColumn.footerTemplate
width?
optionalwidth:ColumnAttributeCallbackHandler<string>
(Optional) Column width.
If the global resizable option is not active, the given <N>px value additionally acts as a
minimum width, preventing columns from shrinking below their configured width in wide tables.
Default
"auto"
Examples
width: "60px"
width: "de:60px;en:80px"
width: (options) => {
const anyBigNumber = options.rows.some((row) => row.totalAmount > 999)
return anyBigNumber ? "100px" : "60px"
}
Inherited from
render?
optionalrender:ColumnAttributeCallbackHandler<string>
(Optional) Display text for the cell. The callback has the current row (row) available in
addition to the usual ColumnAttributeCallbackOptions.
Default
null
Examples
render: (options) => options.row.taxRate + "%"
render: (options) => {
// Check for access profile
return options.row.iban.substring(0, 5) + "xxxxxxxxxx" +
options.row.iban.substring(options.row.iban.length - 3)
}
Inherited from
disableInternationalization?
optionaldisableInternationalization:ColumnAttributeCallbackHandler<boolean>
(Optional) Should localization be disabled for the column? Useful when cell values contain semicolons that are not meant to be part of a localization string.
Default
false
Description
Only for MultiTableReact
Example
disableInternationalization: true
Inherited from
IMultiTableColumn.disableInternationalization
cellBackgroundColor?
optionalcellBackgroundColor:CellColumnAttributeCallbackHandler<string>
(Optional) The cell's background color.
Default
""
Description
Only for MultiTableReact
Example
cellBackgroundColor: "#ff0000"