let current := this;
let list := (flteredList_Aufgaben[cnt(Auftrag.Aufgaben) > 5] order by cnt(Auftrag.Aufgaben));
let maxEntries := 'Einträge pro Seite';
let currentPage := 'Aktuelle Seite';
let paginatedList := unique(record(Aufgaben,0))[!= 0];
for listItem in slice(list.Nr, maxEntries * (currentPage - 1), maxEntries * currentPage) do
paginatedList := unique(paginatedList, record(Aufgaben,listItem))
end;
let data := {
uniqueListId: "Aufgaben Demo 1",
tableId: tableId(first(list)),
height: "600px",
width: "100px",
groupedBy: "Aufgabe",
groupsCollapsed: false,
embedded: false,
table: paginatedList.[{
recordId: Nr,
rowColor: "",
rowHeight: "auto",
rowPaddingY: "10px",
groupRowColor: let currentRecord := Nr;
if cnt(list[Checkliste.Nr = currentRecord.Checkliste.Nr and Erledigt = true]) = cnt(list[Checkliste.Nr = currentRecord.Checkliste.Nr]) then
"#dcf2de"
else
"#eee"
end,
columns: [{
field: "Erledigt",
title: arcCheckBox({
value: if cnt(list[Erledigt = true]) != cnt(list) then
false
else
if cnt(list[Erledigt = null]) = cnt(list) then
null
else
if cnt(list[Erledigt = true]) = cnt(list) then
true
end
end
end
}),
value: arcCheckBox({
value: Erledigt
}),
width: "40px",
align: "center",
fixed: "left",
actions: [{
recordId: Nr,
type: "update",
field: "G",
value: if Erledigt = true then null else true end,
headerAction: true
}],
groupValue: arcCustomIcon({
name: "caret-circle-double-down-fill"
})
}, {
field: "Aufgabe",
title: "Aufgabe",
width: "",
value: replace(Aufgabe, ">", "❯"),
actions: [{
recordId: Nr,
type: "popup",
showPopupButton: true
}],
groupValue: html("<b>" + Auftrag.Titel + "</b>"),
groupByValue: Auftrag.Nr
}, {
field: "'Erledigt am'",
title: "Beschreibung",
value: arcCustomInput({
uniqueId: "Mein-Textarea-" + Nr,
recordId: Nr,
fieldId: "B",
title: Beschreibung,
value: Beschreibung,
type: "textarea",
embedded: true,
disabled: false,
width: "",
height: "auto",
minHeight: "40px",
fontColor: "",
fontSize: "",
fontWeight: "",
backgroundColor: "",
borderWidth: "",
borderColor: "",
borderRadius: "",
placeholderSettings: {
value: "Beschreibe die Aufgabe..."
},
focusAction: {
width: "",
showFocusOutline: "",
outlineWidth: "",
outlineColor: ""
},
alignX: "left",
paddingX: ""
}),
align: "left",
width: "280px"
}, {
field: "'Erledigt am'",
title: "Erledigt am",
value: arcCustomInput({
uniqueId: "Mein-Input-" + Nr,
recordId: Nr,
fieldId: "A1",
title: text(Startdatum),
value: text(Startdatum),
type: "date",
embedded: true,
disabled: false,
width: "",
height: "",
fontColor: "",
fontSize: "",
fontWeight: "",
backgroundColor: "#fff6d8",
borderWidth: "",
borderColor: "",
borderRadius: "",
placeholderSettings: {
value: "Datum eintragen",
fontColor: "#e9595c",
backgroundColor: "#fff7f7"
},
focusAction: {
width: "",
showFocusOutline: "",
outlineWidth: "",
outlineColor: ""
},
alignX: "left",
paddingX: ""
}),
align: "left",
width: "180px"
}, {
field: "Aufgaben",
title: "Aufgaben",
value: arcCustomProgressBar({
uniqueId: "",
width: "",
fontSize: "",
fontColor: "",
backgroundColor: "",
progressColor: "",
valueTotal: cnt(Unteraufgaben),
valueProgress: cnt(Unteraufgaben[Erledigt = true]),
valueText: cnt(Unteraufgaben[Erledigt = true]) + "/" + cnt(Unteraufgaben)
}),
align: "left",
width: "150px",
groupValue: arcCustomProgressBar({
uniqueId: "Erledigte Aufgaben",
title: "",
width: "",
fontSize: "",
fontColor: "",
backgroundColor: "#fff",
progressColor: "",
valueTotal: cnt(Auftrag.Aufgaben),
valueProgress: cnt(Auftrag.Aufgaben[Erledigt = true]),
valueText: cnt(Auftrag.Aufgaben[Erledigt = true]) + "/" + cnt(Auftrag.Aufgaben)
})
}, {
field: "",
title: "",
value: arcCustomButton({
uniqueId: "Unteraufgabe erstellen" + Nr,
title: "Unteraufgabe",
width: "100%",
icon: arcCustomIcon({
name: "plus-bold",
color: "#0062AA"
}),
fontSize: "",
fontColor: "#0062AA",
iconColor: "#0062AA",
backgroundColor: "#0062AA33",
borderColor: "#0062AA",
borderRadius: "50px",
showBadge: false,
badgeTitle: cnt(Unteraufgaben),
badgeColor: "",
badgeBackground: "",
badgeBorderColor: "",
badgePosition: "",
hoverActions: {
fontColor: "#ffffff",
iconColor: "#ffffff",
backgroundColor: "#0062AA",
borderColor: "#0062AA",
animation: "0.5s"
},
actions: [{
type: "create",
tableId: "B",
popup: true,
changeFieldValues: [{
fieldId: "S",
value: number(Nr)
}]
}]
}),
align: "left",
width: "180px"
}, {
field: "Status",
title: "Status",
value: arcCustomSelect({
uniqueId: "Status" + Nr,
currentValue: text(Status),
recordId: Nr,
field: "Q",
width: "100%",
height: "30px",
fontSize: "10px",
placeholder: "Status wählen",
emptyValue: "Zurücksetzen",
items: let id := Nr;
(select Status_Aufgabe).[{
title: Bezeichnung,
active: number(id.Status) = number(Nr),
value: number(Nr)
}]
}),
align: "right",
width: "150px"
}, {
field: "delete",
title: arcCustomIcon({
name: "trash"
}),
width: "40px",
align: "center",
value: arcCustomIcon({
name: "trash"
}),
actions: [{
recordId: Nr,
type: "delete"
}]
}]
}],
footer: {
showFooter: true,
showActionButton: false,
actionButtonTitle: "Neue Aufgabe hinzufügen",
leftSideContent: arcCustomButton({
uniqueId: "Button popUp" + Nr,
title: "Neue Checkliste hinzufügen",
width: "",
icon: arcCustomIcon({
name: "plus-bold",
color: "#0062AA"
}),
fontSize: "",
fontColor: "#0062AA",
iconColor: "#0062AA",
backgroundColor: "#0062AA33",
borderColor: "#0062AA",
borderRadius: "50px",
showBadge: false,
badgeTitle: "",
badgeColor: "",
badgeBackground: "",
badgeBorderColor: "",
badgePosition: "",
hoverActions: {
fontColor: "#ffffff",
iconColor: "#ffffff",
backgroundColor: "#0062AA",
borderColor: "#0062AA",
animation: "0.8s"
},
actions: [{
type: "create",
tableId: "C",
popup: true,
changeFieldValues: [{
fieldId: "",
value: ""
}, {
fieldId: "",
value: ""
}]
}]
}),
rightSideContent: arcCustomPagination({
uniqueId: Nr,
editable: true,
recordId: current.Nr,
fieldId: "P",
direction: "horizontal",
title: current.'Aktuelle Seite',
value: current.'Aktuelle Seite',
total: ceil(cnt(list) / maxEntries),
totalPrefix: " von "
})
}
};
arcCustomTable(data)