oh-repeater nach Item-State sortieren
Verfasst: 14. Apr 2026 14:48
Hallo zusammen,
ich zeige in einem Custom Widget eine Liste von Tankstellen über oh-repeater (itemsInGroup):
Anzeige funktioniert (Label, Preis, Status), aber ich bekomme keine Sortierung nach Preis hin (aufsteigend).
Versucht habe ich schon einiges, aber ohne Erfolg.
Ist eine Sortierung im oh-repeater überhaupt möglich?
Hier mein Widget:
Danke.
Gruß Lenschi
ich zeige in einem Custom Widget eine Liste von Tankstellen über oh-repeater (itemsInGroup):
Code: Alles auswählen
- component: oh-repeater
config:
for: station
sourceType: itemsInGroup
groupItem: =props.groupVersucht habe ich schon einiges, aber ohne Erfolg.
Ist eine Sortierung im oh-repeater überhaupt möglich?
Hier mein Widget:
Code: Alles auswählen
uid: tankstelle_uebersicht
tags: []
props:
parameters:
- context: item
description: Die Gruppe der Treibstoffpreise (z.B. Treibstoffpreise)
label: Gruppe
name: group
required: true
type: TEXT
parameterGroups: []
timestamp: Apr 14, 2026, 12:11:12 PM
component: oh-list-card
config:
title: Tankstellenübersicht
slots:
default:
- component: oh-repeater
config:
for: bestItem
sourceType: itemsInGroup
groupItem: =props.group
filter: "(loop.bestItem.state === items[props.group].state) ? true : false"
slots:
default:
- component: oh-label-item
config:
icon: f7:money_euro
iconColor: green
title: =loop.bestItem.label
after: =(loop.bestItem.displayState || loop.bestItem.state).replace("EUR", "€")
badge: '=(items[loop.bestItem.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "OPEN" ||
items[loop.bestItem.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "ON") ? "OFFEN" : "ZU"'
badgeColor: '=(items[loop.bestItem.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "OPEN" ||
items[loop.bestItem.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "ON") ? "green" : "red"'
footer: Günstigster Preis
style:
--f7-list-item-title-text-color: green
--f7-list-item-after-font-weight: bold
- component: div
config:
style:
height: 2px
background-color: lightgrey
margin: 10px
border-radius: 5px
- component: oh-repeater
config:
for: station
sourceType: itemsInGroup
groupItem: =props.group
slots:
default:
- component: oh-label-item
config:
icon: oh:gasoline
title: =loop.station.label
subtitle: Diesel
after: =(loop.station.displayState || loop.station.state).replace("EUR", "€")
badge: '=(items[loop.station.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "OPEN" ||
items[loop.station.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "ON") ? "OFFEN" : "ZU"'
badgeColor: '=(items[loop.station.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "OPEN" ||
items[loop.station.name.replace("_Diesel",
"_GeoffnetGeschlossen")].state === "ON") ? "green" : "red"'
Gruß Lenschi