Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:55:50+00:00 2026-06-04T16:55:50+00:00

I need to trigger the {{showAlias}} view method from within the {{#each content.activitytypes}} I

  • 0

I need to trigger the {{showAlias}} view method from within the {{#each content.activitytypes}} I have tried {{_parentView.showAlias}}. I believe I need to call it on the parent’s parent, is that correct and how? I can call the {{showAlias}} outside of the {{#each…

Handlebars Template

    <script type="text/x-handlebars">
    <h2>Activities</h2>
    <ul>            
        {{#each Km.activityController}}
        {{#view Km.ActivityView contentBinding="this"}}
            <li>
                {{content.id}}:{{content.name}}
                <ul>
                {{#each content.activitytypes}}
                    <li>{{showAlias}}
                        {{name}} {{aliasname}}
                    </li>
                {{/each}}
                </ul>
            </li>
        {{/view}}   
        {{/each}}
    </ul>
</script>

View

Km.ActivityView = Em.View.extend({

showAlias: function () {
    var arr = this.getPath('content.activitytypes'),
        show = false;
        console.log(arr)
        arr.forEach(function(item) {
            var aliasArr = item.showaliasaccountid;
            if (typeof aliasArr !== 'undefined') {
                if (jQuery.inArray(2,aliasArr)) {
                    console.log(aliasArr);
                    show = true;
                }
            }
        });
}.property('content.@each.activitytype.@each'),
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:55:51+00:00Added an answer on June 4, 2026 at 4:55 pm

    {{parentView.showAlias}} will work, but in these situations with nested views and sub eachs I always find the code to be more maintainable with CollectionViews. Otherwise you end up stuffing too much inside of a single template/view.

    http://docs.emberjs.com/#doc=Ember.CollectionView&src=false

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my app I have need to trigger show some custom view when status
I have a WSDL which I need to trigger some commands from. I need
I need to trigger a block of code after 20 minutes from the AlarmManager
I need to trigger(return) an error event from a VBA function, then the calling
I have a grails app and I need to trigger an cpu-intensive process. I'm
I have two tables TABLE1 and TABLE2 with identical structures. I need a trigger
I have many operations in the database that need to trigger application code. Currently
I would like to launch fancybox from another function. I need this trigger after
I have an event on a page that I need to fire from a
i have something like <a id=link href=home/categoria/>link</a> and i need to trigger a click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.