Can't figure this out, surely simple for someone!

Hi Team

How do I display the contents of TWO groups in this line? tried && and repeating the itemsinGroup command

Using Habpanel

Thank you!

I know you have the answer to this question but we do not.
What UI are you using?

Habpanel sorry. I figured it’s the only UI that has this code. Perhaps not…

You added Habpanel to the OP but your 2 lines disappeared.
I added the tag habpanel to this thread…
I do not use Habpanel.

1 Like

The workaround is to put all the wanted Items in one group for this display purpose.

Yep I’m aware but I don’t want to so that. I’ve got loads of groups already. @ysc do you know how to do this? Display contents of two groups in the ng-repeat?

Uh which line? The code seems to have disappeared from your OP.

damn, sorry!

The line is the second one,

I want to do the ng-repeat with TWO groups without creating a single group and nesting the two. It must be do-able

<div class="controls" ng-hide="collapseStudyShutters">
      <div ng-repeat="item in itemsInGroup('gStudyShutters')">
        <div class="widget wide">
          <div class="icon off">
            <svg viewBox="0 0 48 48"><use xlink:href="/static/ihp-theme/squidink.svg#window"></use></svg>
          </div>
          <div class="name">{{item.label}}
            <div class="value">{{item.value}}</div>
          </div>
          <div class="controlGroup">
            <div class="control" ng-click="sendCmd(item.name, 'UP')">
              <svg viewBox="0 0 80 80"><use xlink:href="/static/ihp-theme/squidink.svg#top-arrow-2"></use></svg>
            </div>
            <div class="control" ng-click="sendCmd(item.name, 'STOP')">
              <svg viewBox="0 0 80 80"><use xlink:href="/static/ihp-theme/squidink.svg#stop_1_"></use></svg>
            </div>
            <div class="control" ng-click="sendCmd(item.name, 'DOWN')">
              <svg viewBox="0 0 80 80"><use xlink:href="/static/ihp-theme/squidink.svg#down-arrow-2"></use></svg>
            </div>
          </div>                  
        </div>  
      </div>
    </div>

Might be a bit hackish, and I cant test it right now, but something like this might work:

item in Groups = itemsInGroup('gStudyShutters').concat(itemsInGroup('gOtherShutters'))

No joy :frowning:

Any errors in the console?

None, i doubt the console would report a habpanel UI code error.

Sorry, I mean the browser console, and that does report AngularJS errors.

Nothing there either that relates to that code, i mean it looks right/accepts it but doesnt display it. Browser console shows no errors. Using that code ends up not displaying any items at all.

@ysc can you chime in please?

in your case that would be something like:

<div ng-repeat="item in itemsInGroup('group1').concat(itemsInGroup('group2'))">{{item.name}}</div>

Thanks @ysc , ill try this. Similiar to what Rolf had mentioned.

What’s itemname at the end?

Unfortunately, this does not work @ysc

<div ng-repeat="item in itemsInGroup('gDownstairsPatioLights').concat(itemsInGroup('gDownstairsGrannyFlatLights') | filter:query as filteredDownstairsPatioLights">

What exactly doesn’t work? Do you get an error in the browser console, what do you see in the browser, and what do you see in the source of the webpage?

No errors, zero feedback using Chrome. As its populating an area in Habpanel, it just shows blank

I am not sure either, as this MWE works fine for me: (note I have used different groups)

<div class="controls" ng-hide="collapseStudyShutters">
    <div ng-repeat="item in itemsInGroup('GroundFloorLights').concat(itemsInGroup('FirstFloorLights'))">
        <div class="name">{{item.label}}</div>
    </div>
</div>

This gives me a nice list of the names of all items in GroundFloorLights, followed by all names of all items in FirstFloorLights.

Maybe it has something to do with everything you are doing with the SVGs and all different classes/divs?