ember-admin
ember-admin copied to clipboard
Column sorting
@bcardarella would you accept a PR that adds column sorting functionality?
@knownasilya maybe, tell me more
Basically a sort on a single column only, so clicking a column name will make it ascending (or descending by default) with some kind of font character representing up/down. If you click on the column name again it would toggle the sorting between the two. Clicking on another column would sort by that column, and remove sort from previous column.
Default sort would be by id in ascending order (I think that's the order currently).
I like it, but I think this is best for a plugin. I actually want to remove the search capability out of this module and move to a plugin for people to add. My reasoning is to keep ember-admin as thin as possible so those using and augmenting don't have to opt-into code they might not necessarily use.
I guess the question is how do we add a hook to be able to make a plugin of the sort?
Confirm. I'll give this some thought as it is may require some upstream changes in ember-cli itself to pull off properly. Off-hand I think ember-admin's base templates should include some named outlets that are unused but can be put to use by certain plugins. I am OK with including named outlets for specific functionality, like {{outlet search}}
and {{outlet sort}}
if that is the extend of the API surface in ember-admin. Then it would be up to external plugins to make use of those outlets and inject themselves into the correct ember-admin internals.
:+1:
Also, for what it's worth, I',m having a hard time imagining a situation where you have large tables of data that you wouldn't want to sort by column
Looking forward to ember-engines being utilized here so plugins are super easy.