tochoromero / aurelia-table

Simple functional data table for Aurelia
https://tochoromero.github.com/aurelia-table
MIT License
67 stars 25 forks source link

Question about sorting a changeable table #28

Closed TheSmedegaard closed 7 years ago

TheSmedegaard commented 7 years ago

I render various datasets in the same table element with different columns(header cells) and a different amount of columns... Like this:

<th repeat.for="column of columns" aut-sort="key: column">${column}</th>

The repeat.for is no problem but how about the sorting. How can I set the right column name for each aut-sort key? I get this error:

Uncaught TypeError: Cannot read property 'toString' of undefined

I've also tried to use the custom sort function like this:

<th repeat.for="column of columns" aut-sort="custom.bind: sort">${column}</th>

But I can't figure out whether it is possible to bind the colum name to the sort function / give it an extra parameter..?

TheSmedegaard commented 7 years ago

https://github.com/tochoromero/aurelia-table/issues/21 aut-sort="key.bind:column"

tochoromero commented 7 years ago

I'm glad the other solution worked for you :)

TheSmedegaard commented 7 years ago

Me too! Thanks 👍