The sizes of all lists are received via the numXYZ signal.
<h6> Ch5-template used with a ch5-list.</h6> <p>The sizes of all lists are received via the numXYZ signal.</p> <template id="viewXYZ"> <ch5-button label="original.label" sendEventOnClick="original.click" receiveStateSelected="original.selected"></ch5-button> </template> <ch5-list maxWidth="300px" receiveStateSize="numXYZ" orientation="horizontal" indexId="idx"> <template> <ch5-template templateid="viewXYZ" context="original:xyz_{{idx}}"> </ch5-template> </template> </ch5-list> <div id="textcontent" class="b-red" data-ch5-textcontent="selected_button_from_list"> DIV: Testing ch5-template inside ch5-list </div> <br> <h6> Ch5-list used inside of a ch5-template</h6> <ch5-template templateid="viewXYZ2" context="original:idx"> </ch5-template> <template id="viewXYZ2"> <ch5-list maxWidth="300px" receiveStateSize="numXYZ" orientation="horizontal" indexId="original"> <template> <div class="xyz"> <ch5-button label="xyz_{{original}}.label" sendEventOnClick="xyz_{{original}}.click" receiveStateSelected="xyz_{{original}}.selected"></ch5-button> </div> </template> </ch5-list> </template>
.b-red{ margin:20px; border:3px solid #004A80; }
Update content of the third element using data-ch5-textcontent.
<h6>The next example showcases a ch5-list using a ch5-template which contains another ch5-template and a <i>data-ch5-textcontent</i> attribute.</h6> <template id="viewOtherStuff"> <div class="otherStuff"><h4 data-ch5-textcontent="OSTUFF"></h4></div> </template> <template id="viewXYZ3"> <div class="xyz"> <ch5-template templateid="viewOtherStuff" context="OSTUFF:INST"></ch5-template> <ch5-button label="xyz_INST.label" sendEventOnClick="xyz_INST.click" receiveStateSelected="xyz_INST.selected"></ch5-button> </div> </template> <div> <p>Update content of the <b>third element</b> using data-ch5-textcontent.</p> <ch5-button type="info" label="Update content" sendEventOnClick="4"></ch5-button> </div> <div> <ch5-list indexId="idx" receiveStateSize="numXYZ" maxHeight="300px"> <template> <ch5-template templateid="viewXYZ3" context="INST:{{idx}}"></ch5-template> </template> </ch5-list> </div>