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

  • SEARCH
  • Home
  • 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 8003535
In Process

The Archive Base Latest Questions

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

I want a View to be hidden on load, then when a user clicks

  • 0

I want a View to be hidden on load, then when a user clicks on a link it will display the view. Can someone review my code and let me know what I have done wrong?

App.parentView = Em.View.extend({   
  click: function() {
    App.childView.set('isVisible', true);
  }
});

App.childView = Em.View.extend({
  isVisible: false
});

Here is the jsfiddle: http://jsfiddle.net/stevenng/uxyrw/5/

  • 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:40:25+00:00Added an answer on June 4, 2026 at 4:40 pm

    I would create a simple isVisibleBinding to the view you want to hide/show, see
    http://jsfiddle.net/pangratz666/dTV6q/:

    Handlebars:

    <script type="text/x-handlebars" >
        {{#view App.ParentView}}
            <h1>Parent</h1>
            <div>
                <a href="#" {{action "toggle"}}>hide/show</a>
            </div>     
            {{#view App.ChildView isVisibleBinding="isChildVisible" }}
                {{view Em.TextArea rows="2" cols="20"}}
            {{/view}}        
        {{/view}}
    </script>​
    

    JavaScript:

    App.ParentView = Em.View.extend({   
        isChildVisible: true,
    
        toggle: function(){
            this.toggleProperty('isChildVisible');
        }
    });
    
    App.ChildView = Ember.View.extend();
    

    A note about your naming conventions: classes should be named UpperCase and instances lowerCase. See blog post about this.

    ​

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

Sidebar

Related Questions

I want to render a view when user clicks on Add New button on
In my view, I want two buttons to populate three hidden fields of a
I have 5 view in storyboard. I want each view orientation will be different
In my view I want to add the text user enter in a textarea
I want to get the value of a hidden field in a grid view
I want to hide the source of image tag. When someone view the page
I am trying to display a hidden div in colorbox using an <a> link's
I have a UInavigationBar that is set to hidden in the view did load.
I have a view controller that houses a UIWebView. I want to display an
i want a view with UITabBAr at The bottom with some buttons+Navigation controller on

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.