ember-admin icon indicating copy to clipboard operation
ember-admin copied to clipboard

Column sorting

Open knownasilya opened this issue 10 years ago • 7 comments

@bcardarella would you accept a PR that adds column sorting functionality?

knownasilya avatar Oct 28 '14 01:10 knownasilya

@knownasilya maybe, tell me more

bcardarella avatar Oct 28 '14 01:10 bcardarella

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).

knownasilya avatar Oct 28 '14 01:10 knownasilya

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.

bcardarella avatar Oct 28 '14 01:10 bcardarella

I guess the question is how do we add a hook to be able to make a plugin of the sort?

knownasilya avatar Oct 28 '14 01:10 knownasilya

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.

bcardarella avatar Oct 28 '14 02:10 bcardarella

:+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

Andrew-Max avatar Jan 25 '16 16:01 Andrew-Max

Looking forward to ember-engines being utilized here so plugins are super easy.

knownasilya avatar Jan 25 '16 16:01 knownasilya