Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frederik Raabye 72 posts 276 karma points MVP 2x c-trib
    Aug 26, 2015 @ 06:58
    Frederik Raabye
    0

    Dynamically adding umb-tab-view in a custom section

    I have created a simple angular resource and controller for a custom backend section. It works great with a static number of hardcoded tabs.

    However, I would to add tabs on the fly if possible. Something like this:

    <form ng-controller="myController" ng-show="loaded">
    
    <umb-panel>
        <umb-header tabs="tabs"><!-- This works as expected. The tab headers get populated. -->
            <div class="umb-headline-editor-wrapper span12 ng-scope">
                <h1 class="ng-binding">Page {{id}}</h1>
            </div>
        </umb-header>
    
        <umb-tab-view>            
            <umb-tab id="tab{{$index+1}}" ng-repeat="tab in tabs"><!-- This does not work. -->
                <div class="umb-pane">
                    <div>
                        This is tab content for tab {{tab.id}}<br />                        
                    </div>
                </div>
            </umb-tab>           
        </umb-tab-view>
    </umb-panel>
    

    The dom appears to be updated correctly, but the tab content is hidden.

    Any suggestions will be highly appreciated.

  • Frederik Raabye 72 posts 276 karma points MVP 2x c-trib
    Aug 26, 2015 @ 07:36
    Frederik Raabye
    101

    The code above does work as expected. I was mistakenly passing a guid instead of an integer as the tab id.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies