-
Notifications
You must be signed in to change notification settings - Fork 848
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
Configure defaultSort per column #677
Comments
Funny I was putting together a codepen demo of how to programatically change sort order and it showed how you can apply a default sort direction to each column. You might be able to use some of the ideas to achieve what you want. |
@christianacca, this is not exactly what I need here. I need to define a default sort direction for column. Suppose you have ng-table with no sorting applied. When users clicks "Name" column, it should be sorted ascending first. On the second click - descending. When user clicks "Date" column, it should be sorted descending firts and then - on the second click - ascending. Now, I'm able to choose whether default sort should be asc or desc, but I can do it only for all columns at once. |
@christianacca Thanks for the codepen demo laying out both ngTable and dynamic versions. Looking to implement a feature which allows columns to be shown/hidden. The dynamic column approach works but needing take control over rendering of table cells (demo33) results in the table definition essentially being duplicated as each td needs to be again specified. Issue 546 asked about accessing TLDR: Is there a strategy for configurable columns using ngTable? If ngTableDynamic, is there an approach to DRY up the table definition when needing control over the cells? |
I think the trick is using bind-html-compile. Then in the js column definition add a field such as content with the desired directive. |
Allows per-column configuration of default sort order for esvit#677
Is there a chance that this get merged when the conflicts are resolved? I manually did the 3 changes of #804 and it works fine (except that If there is a chance of merging, I would create a new pull request which applies on master. |
Hi @georgmu, if you create another PR with some unit tests to support the change I'll be happy to merge... |
One should be able to set the
defaultSort
on column basis.I.e. I want to sort dates descending and names ascending by default.
The text was updated successfully, but these errors were encountered: