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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:51:06+00:00 2026-06-03T08:51:06+00:00

I had a single view with an each helper similar to this: <table class=select-sect

  • 0

I had a single view with an each helper similar to this:

<table class="select-sect" cellspacing="0">
{{#each sections}}
<tr {{bindAttr class="highlight:highlight"}} {{action "selectSection" }}>
  <td class="key">
    {{#each zones}}
      <em {{bindAttr style="color"}}>&nbsp;</em>
    {{/each}}
  </td>
  <td class="sect">{{name}}</td>
  <td class="price">{{currency lowPrice}} - {{currency highPrice}}</td>
</tr>
{{/each}}
</table>

Binding a dynamic class like this worked very well. If I set section.highlight == true in a controller, the view would update with the appropriate class.

“Calling” code:

zone.section.set('highlight', true);

Because I need to handle some other events on each row, I’ve migrated the entire table row to a nested view. I’m searching for a way to make the dynamic class work as it used to.

{{#each sections}}
{{#view SYOS.SelectSectionRowView sectionBinding="this" }}
  <td class="key">
    {{#each section.zones}}
      <em {{bindAttr style="color"}}>&nbsp;</em>
    {{/each}}
  </td>
  <td class="sect">{{section.name}}</td>
  <td class="price">{{currency section.lowPrice}} - {{currency section.highPrice}}</td>
{{/view}}
{{/each}}

I don’t think I can use the same bindAttr solution since it would need to apply to the #view helper. I’ve also tried classNameBindings & classBinding to no avail. Updating section.highlight no longer triggers this view to apply the dynamic class.

View w/ classNameBindings:

SYOS.SelectSectionRowView = Em.View.extend({

tagName: 'tr',

classNameBindings: ['isHighlighted:highlight'],

isHighlighted: function () {
    return this.section.highlight;
} //also tried .property('section')
});

View with classBinding:

{{#view SYOS.SelectSectionRowView sectionBinding="this" classBinding="needsHighlight"}}

in view class:

needsHighlight: function () {
  if (this.section.highlight) {
return 'highlight';
  }

return '';
} .property('section'),

Neither of these seems to do the trick. Can anyone lend any insight into how to get a scenario like this going?

Thanks much!

  • 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-03T08:51:07+00:00Added an answer on June 3, 2026 at 8:51 am

    try classNameBindings: [‘section.highlight:highlight’]

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

Sidebar

Related Questions

If I had 1000 rows, would a single-line separator make the table view bigger
I need to Justify single line text and I had this issue in past
i had questioned here : Best idea for importing text to each NavigationController View
I had an application that hooked onto 1 single database. The app now needs
Had this working; at one stage. The problem is the following text is now
I had this problem before and can't for life of me remember how to
I have a view that displays in a UIPopoverController. Before, it just had properties
It seems that others have had variations on this question, but from what I
I had a Django form that submitted a list of values to my view.
I know how to draw lines/rect in a single view. But I'm lost in

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.