Hi,
I’m working with layouts on custom widget’s. Specifically I’ try to have a set of elements allingned in a row.
Example of what I’ try
uid: widget_flex_block
tags:
- test
props:
parameters:
- default: fals
description: Display row
label: as Row
name: fdir
required: false
type: BOOLEAN
parameterGroups: []
timestamp: Jan 28, 2024, 10:45:07 AM
component: f7-card
config:
title: test widget
slots:
content:
- component: div
config:
class: flex-container
style:
min-heigth: 100px
display: flex
flex-direction: '=(props.fdir == true) ? "row" : "column"'
flex-wrap: wrap
slots:
default:
- component: div
config:
class: flex-item
content: 1
style:
background-color: pink
min-width: 50px
min-height: 50px
text-align: center
- component: div
config:
class: flex-item
content: 2
style:
background-color: lightgreen
min-width: 50px
min-height: 50px
text-align: center
- component: div
config:
class: flex-item
content: 3
style:
background-color: lightblue
min-width: 50px
min-height: 50px
text-align: center
The above example is working but not practicall. That is why I’ try to use the OH-REPEATER to achive the same layout.
The Problem: oh-repeater creates a div element that can not be styled as other components. So my question is:
- Is the code below wrong?
- can it be done in any other way
uid: widget_repeater_block
tags:
- test
props:
parameters:
- default: fals
description: Display row
label: as Row
name: fdir
required: false
type: BOOLEAN
parameterGroups: []
timestamp: Jan 28, 2024, 11:24:49 AM
component: f7-card
config:
title: test widget
slots:
content:
- component: div
config:
class: flex-container
style:
min-heigth: 100px
display: flex
flex-direction: '=(props.fdir == true) ? "row" : "column"'
flex-wrap: wrap
slots:
default:
- component: oh-repeater
config:
class: repeater-element
for: element
sourceType: range
rangeStart: 1
rangeStop: 5
style:
flex-direction: '=(props.fdir == true) ? "row" : "column"'
slots:
default:
- component: div
config:
class: flex-item
content: =loop.element_idx
style:
background-color: lightblue
min-width: 50px
min-height: 50px
text-align: center
Tis is where my problem lays, the repeater creates a div element that can not be styled, even the class atribute can not be set.
is this a bug, done so by design, or do I’ miss somthing?
thanks
Ernst