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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:40:37+00:00 2026-06-08T17:40:37+00:00

Having a view that should represent a table, having columns and rows : App.ListView

  • 0

Having a view that should represent a table, having columns and rows:

App.ListView = Ember.View.extend({
  templateName: 'list',
  columns: ['t1', 't2', 't3'],
  rows: [
    { t1: 'one', t2: 'two', t3: 'three' },
    { t1: 'two', t2: 'one', t3: 'seven' }
  ]
});

– respectively a template:

<table>
<thead>
  <tr>
  {{#each columns}}
    <th>{{this}}</th>
  {{/each}}
  </tr>
</thead>
<tbody>
{{#each rows}}
  <tr>
  {{#each ../columns}}
    <td>does nothing: {{this}}</td>
  {{/each}}
  </tr>
{{/each}}
<tbody>
<table>

… which can be found on jsfiddle as well: jsfiddle.net/nWnf2

I obviously can not iterate over columns when nested in rows. {{#each ../columns}} simply is not triggered at all. Why is that? What is a better approach?

  • 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-08T17:40:41+00:00Added an answer on June 8, 2026 at 5:40 pm

    Ember doesn’t really support the file path identifiers from Handlebars. You can however access via view.columns.

    <table>
      <thead>
        <tr>
        {{#each columns}}
          <th>{{this}}</th>
        {{/each}}
        </tr>
      </thead>
      <tbody>
      {{#each rows}}
        <tr>
        {{#each view.columns}}
          <td>does nothing: {{this}}</td>
        {{/each}}
        </tr>
      {{/each}}
      <tbody>
    <table>
    

    http://jsfiddle.net/L7MAp/

    Looking at your code snippet, I suggest you look at using {{#collection}} instead of {{#each}} as well, it won’t alleviate that issue but it makes your code cleaner (IMO).

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

Sidebar

Related Questions

I have a table view that is managed by an NSFetchedResultsController. I am having
I'm having trouble getting ember to render a dynamic child view. It seems that
With MVC3, should I design my view models such that there is one that
Using Asp.net MVC, I have one view that's strongly bind to List , and
I am having table view in my iPhone application. The requirement is that I
I am having problems referencing scripts that should be included in my view, when
Im having a very strange problem, i have a complicated view that returns incorrect
I'm having an issue with backbone.js' models. I have a view that creates another
I heard that having @foreach inside of a view is a no-no. Meaning, the
How do I go about having two view models communicate with one another using

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.