aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

add ability to sort columns via functions #435

Closed sturmer-eha closed 8 years ago

sturmer-eha commented 8 years ago

this is a small tweak that I've had to implement within the package in order to make one table with scattered schema to properly sort by the combined sum of different values

please feel free to reimplement, extend, or merge

aslagle commented 8 years ago

Thanks! This looks great, and it's cool someone from EHA is still using this package :)

There are two things I would change:

sturmer-eha commented 8 years ago

Your origami cube and stars are still here by the way. Built to last, just like the reactive-table.

I've updated the function's arguments and the line you've mentioned. Might've done something which is not exactly what you've meant, since I don't know the internals of the package that well. Please let me know if the logic on that line needs to be altered.

Thanks for maintaining this package!

aslagle commented 8 years ago

Thanks for making the changes :)

I'm not totally sure what that line should be either, but I think I'd go with field.sortByValue || (!field.fn && !field.sortFn). That would let you use sortFn without fn which could be useful, and if sortFn is undefined it does the same thing as before so it's more backwards-compatible.

sturmer-eha commented 8 years ago

I believe this should be good to go.

aslagle commented 8 years ago

Thanks :)

sturmer-eha commented 8 years ago

Likewise Ü