Zum Hauptinhalt springen

Spaltentyp 'badge'

Live Beispiel

Beispielcode

context.enableModules();
const { TableGadget } = require("ou.sp.gadget.TableGadget");

const gadget = new TableGadget({
showOptions: false,
showFooter: false,
select: false,
rows: [
{
globalState: "10",
status: "10",
},
{
globalState: "20",
status: "20",
},
{
globalState: "100",
status: "100",
},
{
globalState: "98",
status: "98",
},
],
columns: {
globalState: {
type: "badge",
label: "Status",
badges: {
"10;de:Erfassung;en:Created": "#ff5722; color:#fff;font-size: 16px;border-radius: 10em",
"30;de:In Prüfung;en:Validating": "",
"98;de:Fehler;en:Error": "error",
"100;de:Abgeschlossen;en:Done": "success",
},
badgeAsPill: true,
},
status: {
type: "badge",
label: "Status ohne Mapping",
},
},
});

context.returnValue = gadget.transfer();