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 8366783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:59:58+00:00 2026-06-09T12:59:58+00:00

I have a view that has expandable/collapsable content that I’d like to be able

  • 0

I have a view that has expandable/collapsable content that I’d like to be able to toggle by clicking the on the table row. Before pre1.0, I had this in the template:

<tr {{action "expand"}}>

which was previously handled on my view:

App.ContentRowView = Em.View.extend({
   templateName: 'ember/templates/content/row',
   expand: function() {
      this.set('isExpanded', !this.get('isExpanded'));
   },
   isExpanded: false
});

However, after upgrading to pre1.0 the action is now fielded directly by the router. This makes sense in a lot of situations, but in this case the expansion is really a view concern. I’ve tried just replacing this with a click event handler without luck.

Is there a best practice on how to handle a view concern event like this with pre1.0?

  • 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-09T13:00:00+00:00Added an answer on June 9, 2026 at 1:00 pm

    Deprecated Answer


    Even if the answer of @outside2344 works, I think it’s not exactly right.
    Indeed parentView does not represent the view, but the parentView of its parentView.
    Since 1.0-pre, views preserve their context, so in the template, this represents the parentView, parentView represents parentView.parentView, and view represents the current view.
    Here is a fiddle to illustrate this: http://jsfiddle.net/Sly7/cnmJa/

    For me the answer is {{action expand target="view"}}

    EDIT (answering to @Gal Ben-Haim)

    Action helpers behave little different in a router-based application. Quote from the documentation:

    In Router-driven applications, if an action is not intercepted by a view, that event will bubble up to the Route in which that view was rendered. If that Route is a sub-route of another Route the transition will be sought there all the way up to the top-level Route definition, our über-container: root.

    This bubbling effect allows certain actions to remain private. If certain transitions should only be available for certain sub-sub-states, put the transition on the sub-state and you’ve achieved a type of scoping.

    Basically, for me that means in Router-driven apps if you don’t explicitly define a target in the action helper, it is sent to the router.


    Updated answer

    I think now the guides answer very well to this question. see http://emberjs.com/guides/templates/actions/#toc_specifying-a-target

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

Sidebar

Related Questions

I have a view that has a column to make it sortable. When clicking
I have never seen this before. I have a simple custom view that has
So say that I have a table view that has a UINavigationController. On top
I have a view that displays a table: rows represent days - one row
I have a view that has several options, and inside it is a table
I have view a that has a table cell and a save button. If
I have a view that has a tooltip attribute. I want to set that
I have a view that has multiple views inside it, and an image presentation
Scenario: I have a view that has some DataTemplate resources <DataTemplate x:Key=myDragCueTemplate> <Border Background=Blue
In my app I have a view that is a form that has quite

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.