TableDialog
Deprecated
use TableDialogReact from ou.sp.gadget.TableDialogReact instead
Implements
Constructors
Constructor
new TableDialog(
options):TableDialog
Erstellt eine neue TableDialog Instanz.
Parameters
options
Die Konfiguration
Returns
TableDialog
Example
context.returnValue = new TableDialog({
rows: [
{ id: "1", name: "name1" },
{ id: "2", name: "name2" },
{ id: "3", name: "name3" }
]
}).transfer();
Properties
options
options:
TableDialogOptions
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):TableDialog
Erstellt ein neue TableDialog Instanz mit den gegebenen Zeilen.
Parameters
rows
object[]
Returns
TableDialog
Example
context.returnValue = TableDialog.from({
rows: [
{ id: "1", name: "name1" },
{ id: "2", name: "name2" },
{ id: "3", name: "name3" }
]
}).transfer();
fromFileResultset()
staticfromFileResultset<TFileTypeName>(fileResultset,fields?):TableDialog
Iterate through an FileResultset
Type Parameters
TFileTypeName
TFileTypeName extends string | number | symbol
Parameters
fileResultset
FileResultset<TFileTypeName>
fields?
string[]
Returns
TableDialog
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):TableDialog
Iterate through an HitResultset
Parameters
hitResultset
HitResultset
Returns
TableDialog
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):TableDialog
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
TableDialog
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):TableDialog
Kompatiblität für altes TableResultDialog
Parameters
config
TableResultDialogConfiguration
dbUser
string
Datenbank Benutzer
dbPassword
string
Datenbank Passwort
Returns
TableDialog
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.TableDialog");
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>