Hi,
i’m finding new problems every day and so this is my next post with a main-ui problem.
i have made a (tabbed) page with 3 list widgets where i use oh-repeater with sourceType = group
.
the (custom) widgets work but they all work kind of “slowly”.
Here’s how the tabbed page behaves:
Tab “Home” has no oh-repeater, tabs “Licht” and “RS” both have widgets with oh-repeater and sourceType = group
and the last tab (“RS_M”) has basically the same widgets but sourceType = array
.
The page with sourceType = array
loads faster than the pages with sourceType = group
i have 1071 items and i guess this is why the widget with sourceType = group
takes “this long” to load, right?
with sourceType = array
i have to define the items within the YAML code and that’s not ideal because i have to create a new widget for every group. looks like this:
- component: oh-repeater
config:
for: listItem
sourceType: array
in:
- item: Büro
label: rs_buero
- item: rs_foyer_links
label: Fy links
- item: rs_foyer_mitte
label: Fy mitte
- item: rs_foyer_rechts
label: Fy rechts
- item: rs_kueche
label: Küche
i could work with one widget if i define the items via props but i couldn’t figure that one out… tried with array this way:
- component: oh-repeater
config:
for: listItem
sourceType: array
in:
- item: =props.item1
label: =props.label1
- item: =props.item2
label: =props.label2
this is not working. the widget just uses “props.item1” etc.
then i tried with sourceType = range
- component: oh-repeater
config:
for: listItem
sourceType: range
rangeStart: 1
rangeStop: 7
rangeStep: 1
but i couldn’t figure out how to combine it so this:
item: =items[props.item + loop.listItem]
in the end would translate to
item: =items[props.item1]
item: =items[props.item2]
etc.
or
text: =props.label + loop.listItem
>>> text: =props.label1
it would be great if you guys could help me out again!