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

Exposing model for #link-to in each row. #2

Closed
snewcomer opened this issue Mar 14, 2016 · 4 comments
Closed

Exposing model for #link-to in each row. #2

snewcomer opened this issue Mar 14, 2016 · 4 comments

Comments

@snewcomer
Copy link
Collaborator

Great project by the way! So much more I can get out of a grid with this add on.

So I am trying to figure out how each row could be wrapped with a link-to (if there already isn't one!). Not exactly sure, but does the row variable contain the model instance? If so, would exposing the row variable in hash be one solution to this?

https://github.com/offirgolan/ember-light-table/blob/master/addon/templates/components/lt-body.hbs#L7

@offirgolan
Copy link
Collaborator

You can use the onRowClick action which passes you the row that was clicked. From there you can do a transitionToRoute. Is that what you are looking for?

{{t.body onRowClick=(action 'rowClicked')}}

@snewcomer
Copy link
Collaborator Author

Yep! I guess if I extend from the component class rather than the controller class, then I might run into some problems. That's maybe why a link-to helper with the model instance might be nice to expose in the template.

But now that I think about it, I probably shouldn't declare the table with a component class if I want some query params in the url as well. :)

@offirgolan
Copy link
Collaborator

You can always use the tableActions property to effectively propagate your actions.

See docs here

@snewcomer
Copy link
Collaborator Author

Thx!

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