-
Notifications
You must be signed in to change notification settings - Fork 724
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
Remove Column from sorting #372
Comments
Nope, not at the moment. What is your use case? |
my requirement is simple that i don't want sorting for a column which is a template column |
One may want to allow sorting by template, since the sort param can be tweaked in a request interceptor... We'll leave it like that. |
I believe this should be supported. In my case, the backend does not allow to sort by some fields, so trying to click on the column header just shows an error. It would be cool if we could explicitly disable sorting for some fields |
I am open to debate on how we can best implement this enhancement. Though, I think the following adjustments would do. @fzaninotto - Can you commit these changes to the core codes? I am dealing with the same problem as @0xDCA. In admin-config, field.js
Update ng-repeat in grid template in src/javascripts/ng-admin/Crud/list/maDatagrid.js
To disable column sort for a particular field, simply invoke disableSort().
|
Use-case for me is, that I don't want to sort fields which are references. The displayed values will not appear sorted in most cases, because its sorted by the underlying value and not by the displayed value (e.g. sort messages by user-id, but display user-name from reference). |
+1 from me -- I have an |
I'll create a PR for this. As a matter of coding style, why does Would a PR which omitted that change and directly set a |
|
👍 |
👍 |
👍 This is so obviously necessary it's difficult to understand how it is still dragging on over a year later. A workaround is to disable the listView heading links using CSS and the ng-admin column classes: th.ng-admin-column-[fieldName] a {
pointer-events: none;
color: black;
} |
It's not really that difficult to understand -- the project is open source and free, and the maintainers work on a voluntary basis. (While I'm on the subject -- thanks for making |
Is there any options to remove a particular column from sorting
The text was updated successfully, but these errors were encountered: