Sort by element entries columns! #14698
Replies: 3 comments
|
Joining in the related entries via a subquery to sort on them would have a noticeable impact on performance, especially with hundreds of thousands of entries. So technically, sorting by a dynamically-generated column is ideal. But I can see how it would be nice if the UI could map your Entries custom field column with that generated column, so it looks like you’re sorting by the relations. |
|
Perhaps it can be an option then. disable it by default, but then have an option "enable sorting by entry type field - warning this can cause performance issues on columns with many fields." In many cases we might just want this anyway, because the performance on small data sets is pretty minor. Alt version, is kind of do what I did, create a calculated column option that automatically saves the values from the entry fields. It's a bet janky tho - because you have to update on save but also loop through an update every time the entry field saves, looping through all entries that contain that entry. |

Uh oh!
There was an error while loading. Please reload this page.
Right now "element field" columns are unclickable to sort in the control panel. Probably because some of them support multiple values? Even sort, you could just sort by some kind of concatenation where the multivalues condense. Like this is alphabetical:
A
A,B
A,C
B,C,D
C,A
D
ETC
To get around this limitation, I had to create a module where I make a read-only calculated fields. Then I sort on the custom calculated fields (that have a value of the element entry title). would be way nicer to just sort on the entry field itself. I have a CMS with about 6 such fields. Would love to just click on the column header to sort.
Thanks!
All reactions