Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-row custom classes #32

Closed
artsyca opened this issue Nov 6, 2015 · 4 comments
Closed

Per-row custom classes #32

artsyca opened this issue Nov 6, 2015 · 4 comments
Assignees

Comments

@artsyca
Copy link

artsyca commented Nov 6, 2015

I'd like to add a class to the row based on criteria of the record.
For example if record.isFinalized I'd like to add is-finalized to the tr (or each of its children)

Currently I can modify the template directly to add my class based on record like:

<tr class="{{if record.isFinalized "is-finalized"}}">

and it works, but it requires copying the templates/models-table.hbs into my project manually.. A configuration option would be most welcome here.

@onechiporenko
Copy link
Owner

Hi, @artsyca.
I'm thinking about your suggestion and can't find a best way to implement it.
Most simple way it's move:

<tr>
              {{#each processedColumns as |column|}}
                {{#if column.isVisible}}
                  <td class={{column.className}}>
                    {{#if column.template}}
                      {{partial column.template}}
                    {{else}}
                      {{get record column.propertyName}}
                    {{/if}}
                  </td>
                {{/if}}
              {{/each}}
            </tr>

to the separated template.

@artsyca
Copy link
Author

artsyca commented Nov 9, 2015

Yes. I like the control of overriding templates as long as it can be done in a future proof way.

So far this addon fits my needs very closely and works great with Ember 2.1.

@KirillSuhodolov
Copy link

  • 1 to have this feature built-in.

@onechiporenko move to separate template good idea. It can be custom row template

onechiporenko pushed a commit that referenced this issue Nov 16, 2015
@onechiporenko
Copy link
Owner

rowTemplate-property is available now .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants