API
constructor
new MultiGadget(options: MultiGadgetOptions): MultiGadget
Beispiel:
context.enableModules(),
const { MultiGadget } = require("ou.sp.gadget.MultiGadget");
context.returnValue = new MultiGadget({
header: {
label: "MultiGadget",
icon: "ionicons ion-ios-cafe",
tooltip: "Beispiel Tooltip",
click: () =>
documentsContext.openMessageDialog(
"Header Clicked",
"Header Clicked",
() => {},
() => {}
),
},
script: "ou.cust.demo.dashboard.callback.loadButtons",
}).transfer();
ou.cust.demo.dashboard.callback.loadButtons:
const { MultiTableOptionsHelper } = require("ou.sp.gadget.MultiTableOptions");
const buttons = [
{
label: "Hello, World from server",
icon: "ion-md-globe",
tooltip: "Button 1 Tooltip",
click: "ou.cust.demo.dashboard.callback.helloWorld",
styles: {
height: "115px",
flexBasis: "115px",
},
iconStyle: {
fontSize: "40px",
},
labelStyle: {
fontSize: "14px",
},
},
{
label: "Button 2",
icon: "ion-ios-hammer",
tooltip: "Button 2 Tooltip",
click: (item) =>
documentsContext.openMessageDialog(
"Clicked " + item.label,
"Clicked " + item.label,
() => {},
() => {}
),
dropdown: [
{
label: "Button 2.1",
icon: "ion-ios-nuclear",
tooltip: "Button 2.1 Tooltip",
click: (item) =>
documentsContext.openMessageDialog(
"Clicked " + item.label,
"Clicked " + item.label,
() => {},
() => {}
),
},
],
styles: {
height: "115px",
flexBasis: "115px",
},
iconStyle: {
fontSize: "40px",
},
labelStyle: {
fontSize: "14px",
},
},
];
context.returnValue = MultiTableOptionsHelper.stringify(buttons);
tipp
Die Buttons müssen nicht unbedingt über ein Skript geladen werden. Sie können auch direkt über das buttons-Attribut übergeben werden.