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

Can't apply sorting to dynamic columns #21

Closed
esnyder232 opened this issue Jan 28, 2017 · 4 comments
Closed

Can't apply sorting to dynamic columns #21

esnyder232 opened this issue Jan 28, 2017 · 4 comments
Assignees
Labels

Comments

@esnyder232
Copy link

Hey,

We're trying to make a table with dynamic headers. The documentation states to sort by using "key: [column-name]". If a key is "a string with the name of the column it will sort by" then by using the Aurelia convention you should be able to apply string interpolation like so:

<th repeat.for="col of headers" aut-sort="key: ${col}">

This resulted in an error message saying that key was null.
Is there something we're doing wrong or do you think this is something that will be supported in the future?

Thanks,
Eric

@tochoromero
Copy link
Owner

Hello Eric.

This is a use case I have not considered before. I will see what can be done about it.

@tochoromero
Copy link
Owner

You were very close in your syntax. I just did some testing and this will work:
<th repeat.for="col of headers" aut-sort="key.bind:col">

Cheers

@esnyder232
Copy link
Author

Yeah that worked!
Thanks alot man!

@tochoromero
Copy link
Owner

You are welcome :)

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

No branches or pull requests

2 participants