TableDialogReact
Implements
Constructors
Constructor
new TableDialogReact(
options):TableDialogReact
Erstellt eine neue TableDialog Instanz.
Parameters
options
Die Konfiguration
Returns
TableDialogReact
Example
context.returnValue = new TableDialog({
rows: [
{ id: "1", name: "name1" },
{ id: "2", name: "name2" },
{ id: "3", name: "name3" }
]
}).transfer();
Properties
options
options:
TableDialogReactOptions
Implementation of
Methods
transfer()
transfer():
string
Konvertiert die Instanz in ein JSON um die Daten zurück an das TableDialog am Client zu senden
Returns
string
Example
context.returnValue = tableDialog.transfer()
show()
show():
string
Returns
string
toString()
toString():
string
Returns a string representation of an object.
Returns
string
saveAsXlsx()
saveAsXlsx(
filePath):MultiTableXlsxExporter
Speichert die Instanz als Excel-Datei ab.
Parameters
filePath
string
Der Zielpfad (inkl. Dateiname) z.B. "D:\tmp\test.xlsx"
Returns
Implementation of
IXlsxExportableMultiTable.saveAsXlsx
downloadAsXlsx()
downloadAsXlsx(
filePath):string
Parameters
filePath
string
Returns
string
from()
staticfrom(rows):TableDialogReact
Erstellt ein neue TableDialog Instanz mit den gegebenen Zeilen.
Parameters
rows
object[]
Returns
TableDialogReact
Example
context.returnValue = TableDialog.from({
rows: [
{ id: "1", name: "name1" },
{ id: "2", name: "name2" },
{ id: "3", name: "name3" }
]
}).transfer();
fromFileResultset()
staticfromFileResultset<TFileTypeName>(fileResultset,fields?):TableDialogReact
Iterate through an FileResultset
Type Parameters
TFileTypeName
TFileTypeName extends string | number | symbol
Parameters
fileResultset
FileResultset<TFileTypeName>
fields?
string[]
Returns
TableDialogReact
Example
const { TableDialog } = require("ou.sp.gadget.TableDialog");
const fileResultset = new FileResultset("YOURFILETYPE")
const fields = ["field1", "field2"]
context.returnValue = TableDialog.fromFileResultset(fileResultset, fields).transfer();
fromHitResultset()
staticfromHitResultset(hitResultset):TableDialogReact
Iterate through an HitResultset
Parameters
hitResultset
HitResultset
Returns
TableDialogReact
Example
const { TableDialog } = require("ou.sp.gadget.TableDialog");
const hitResultset = new HitResultset(searchResources, filter, sortOrder, hitlist)
context.returnValue = TableDialog.fromHitResultset(hitResultset).transfer();
fromDatabase()
staticfromDatabase(query):TableDialogReact
Creates an TableDialog instance by using a SelectBuilder. It uses the SelectBuilder to get the columns and rows. For the column definition it uses the column alias or name as label and the type from the given type.
Parameters
query
The SelectBuilder to get the columns and rows
Returns
TableDialogReact
Example
const { TableDialog } = require("ou.sp.gadget.TableDialog");
const args = TableDialog.getParams()
const db = new DBConnection("odbc", "invoicecontroldb", "user", "pwd")
const query = SelectBuilder
.from("costcenter", db)
.select([{
name: "id",
alias: "Kostenstelle",
type: "number",
},{
name: "costcenterName",
alias: "Kostenstelle Bezeichnung",
type: "string",
},
])
.where("costcenterName like '" + args.searchValue + "%'");
context.returnValue = TableDialog.fromDatabase(query).transfer();
// Generates a gadget with the costcenters from the database with the column header "Kostenstelle" and "Kostenstelle Bezeichnung"
fromLegacy()
staticfromLegacy(config,dbUser,dbPassword):TableDialogReact
Kompatiblität für altes TableResultDialog
Parameters
config
TableResultDialogConfiguration
dbUser
string
Datenbank Benutzer
dbPassword
string
Datenbank Passwort
Returns
TableDialogReact
show()
staticshow(config):string
Zeigt ein TableDialog an. Der context.returnType wird auf "clientScript" gestellt.
Parameters
config
Returns
string
Example
const { TableDialog } = require("ou.sp.gadget.TableDialogReact");
context.returnValue = TableDialog.show({
title: "Test",
rows: [
{ id: "1", name: "name1" },
{ id: "2", name: "name2" },
{ id: "3", name: "name3" },
]
})
getParams()
staticgetParams():Record<string,unknown>
Gibt das geparste params Objekt zurück, welches vom Userexit übergeben worden ist.
Returns
Record<string, unknown>