Reuse xxx.widget.json Elements inside Modal Window

I’ve done a simple switchbtn.widget with a controller etc. like this:

<div oc-lazy-load="['/static/switchbtn.controller.js']" class="expandall">
  <div ng-controller="switchbtn" class="expandall">
    <table class="expandall click-animate" ng-click="sendCmd(config.item_cmd, ((itemValue(config.item_status) == 'OFF') || (itemValue(config.item_status) == 'NULL')) ? 'ON' : 'OFF')">
      <tr style="height:{{ config.text_row_height }};" ng-if="config.show_text == true">
        <td style="vertical-align:bottom;">
          <div style="text-align:center;font-size:100%">
            {{ calcText() }}
          </div>
        </td>
      </tr>
      <tr>
        <td style="vertical-align:middle;">
          <div style="text-align:center;">
            <i style="display:grid;{{ calcIconStyle() }}" class="{{ calcIconName() }}"></i>
          </div>
        </td>
      </tr>
    </table>
  </div>
</div>

Now I thought about instead of sending an item command sendCmd I open up a modal window. This I already tried from the template examples and it seems to work.

This modal window itself should contain several switchbtn.widget elements.
Is it possible to source xxx.widget.json elements passing to it different settings (e.g. for the item) so that I can “instantiate” many elements?

thx

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.