Feature Request: Sort by actual, not total, when using cascading searchpanes
Feature Request: Sort by actual, not total, when using cascading searchpanes
When sorting the results of a cascading searchPanes with the viewTotal option, it seems more intuitive to sort by the actual counts and not the total.
In this case, there's another filter already on, and now I want to see what options are left to apply an additional filter. (In fact, I'd like a way to toggle showing the zero-results, but of course I sometimes want them for an additional selection).
Since this is done in javascript, it seems doable. As I mentioned in another discussion, I'd like to be able to format the actual and total as well.
Replies
Good idea - thanks for the suggestion. I've added it to the list.
Allan
On a related note, can you add classes to the total and viewTotal? I'd like to make the numbers a fixed-width font. The "2" is wider than the 3 so to my eye it looks a bit funny, the smaller number being wider. Tiny issue, I know.
If this were a function, I could also format it for large numbers, perhaps 3.1k would be more readable? Just brainstorming.
You could use:
if you wanted to target just the pill text.
Good idea about the 1.9K (etc) formatting. I like that option - thanks!
Allan
It's so awkward to not be able to sort by the actual total that I'm considering reversing what the JSON returns (to populate the searchPanes) so that I can sort.
Before I implement that hack, any chance this could be prioritized?
Thanks!
I'd love to say yes, but I've got such a long list at the moment that it just won't be possible, sorry.
Allan
I'm curious if this has been implemented already? Thanks!
No, it hasn't, I'm afraid, it's in the list still. Allan will be rewriting SearchPanes as one of his next big projects, so it won't be too long.
Colin
Thanks for the quick reply @colin ! This would be such a useful fix to have. I can't imagine it to be a big job, but so far snooping into the codebase hasn't yielded any fruit...
Thanks! Alexander.
The SearchPanes rewrite is likely several months away at this point I'm afraid.
Allan
Thanks @allan ! I'd be happy to have a stab at this, assuming it isn't much more dramatic than a row.shown/row.total exchange in the right place? But maybe I'm underestimating the effort needed. I'll keep digging, maybe I find the correct approach. Thanks!
I suspect to just make it work wouldn't be too bad - look for the orthogonal data for the pane's DataTable. However, making it configurable and retaining backwards compatibility, adding tests and documentation all takes time. Its one part of the multitude of things that need to be updated in SearchPanes.
Allan
Is backwards-compatibility necessary? I can't imagine when it would be useful to be sorted by overall total rather than filtered total. If you define it as a bug, then it's just a fix.
What's the use-case where you'd want it sorted as it is?
This would be such a huge help. I'm not sure it needs a rewrite of SearchPanes. IMHO. Thanks for your consideration.