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

yielding row #8

Closed
ghost opened this issue Mar 24, 2016 · 4 comments
Closed

yielding row #8

ghost opened this issue Mar 24, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 24, 2016

This is similar to #2.
I have a few tables in an ember application that use a component for a row. Can light-table or one of the contextual components yield an individual or something like that? My use case is to customize the HTML of each row.

{{#t.body as |body row|}}
{{my-row-component row=row}}
{{/t.body}} 

I would need to this to happen before the user clicks on a row, so body.expanded-row wouldn't apply. There doesn't seem to be a way to customize the HTML of the individual rows. I'm open to other ideas too.

@snewcomer
Copy link
Collaborator

cellComponent might help out, but not for the entire row (just that column) which I'm sure you are already aware of. This allows the use of a component instead of just the model property. I can see the use case where each individual component would need customization (i.e. multiple model properties, avatars, ect) and styling for the entire row can be targeted via the lt-row class. I'm sure though that having access to the row is useful in other scenarios that I'm not thinking of.

https://github.com/offirgolan/ember-light-table/blob/feab5b45dadbbddb135cdf14da553c9fcfca1e38/tests/helpers/table-columns.js#L6

@ghost
Copy link
Author

ghost commented Mar 25, 2016

thanks for pointing that out; I hadn't noticed that. I'll give that a whirl as it might resolve my specific case.

@offirgolan
Copy link
Collaborator

@snewcomer Thanks for helping out 😸. I can definitely see the need for this. When I have some free time Ill look more into this and see what I can do.

@efx let me know if that solves your use-case!

@ghost
Copy link
Author

ghost commented Mar 27, 2016

I'll close for now since I think cellComponent provides the flexibility I need. Thanks folks!

@ghost ghost closed this as completed Mar 27, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants