Question
Custom Widget with SubWidget
- September 17, 2020
- 2 replies
- 2010 views
Hello Community,
we decided to use some more custom CSS in our UI and would like to leverate the bootstrap CSS.
For this purpose I am currently developing some Custom Widgets that should enhance our layouts
and look & feel.
The idea is to use the Bootstrap Card Class and make it an container widget, that by itself contains a
flexcontainer. So it should have the structure:
<div class="card">
<div class="card-header">Header</div>
<div class="card-body">
<!-- Create Flex Container here -->
</div>
</div>
I had a closer look at the tabsv2-Widget how to do this and created a simple widget with similar behaviour (attached zip), but I have a massivie issue with the placement of the SubWidget.
The Code creates final HTML like this:
<div id="root_panelext-14-bounding-box" class="widget-bounding-box nonresponsive" style="top: 5px; left: 5px; width: 337px; height: 218px; z-index: 1510;">
<div class="widget-content widget-panelext card text-white bg-secondary" id="root_panelext-14" style="width: 337px; height: 218px;">
<div class="card-header"> Caption Test </div>
<div class="card-body" sub-widget-container-id="panelext-14" sub-widget="1">
<h5 class="card-title">Card Title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card content.</p>
</div>
<div id="root_flexcontainer-15-bounding-box" class="widget-bounding-box nonresponsive widget-flexcontainer-bounding-box no-flex-wrap flex-leaf-static" style="position: relative; z-index: 1510; flex: 1 1 auto;">
<div class="widget-content widget-flexcontainer widget-container tw-flex-row"
style="background: -webkit-linear-gradient(top, rgb(0, 96, 204) 0%, rgb(1, 61, 182) 100%); border-width: 1px; border-color: rgb(1, 52, 154); border-style: solid; flex-flow: row nowrap; align-items: flex-start; place-content: flex-start;"
id="root_flexcontainer-15"></div>
</div>
</div>
</div>
So the bounding-box of the flexcontainer in added after the body-tag, not inside.
How can I tell a dynamic created widget which <div> to use?
Greetings
Andreas

