Feature Request: Sort by actual, not total, when using cascading searchpanes

Feature Request: Sort by actual, not total, when using cascading searchpanes

tacman1123tacman1123 Posts: 168Questions: 39Answers: 1

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

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Good idea - thanks for the suggestion. I've added it to the list.

    Allan

  • tacman1123tacman1123 Posts: 168Questions: 39Answers: 1

    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.

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    You could use:

    div.dtsp-nameColumn span.dtsp-pill {
      font-family: monospace;
    }
    

    if you wanted to target just the pill text.

    Good idea about the 1.9K (etc) formatting. I like that option - thanks!

    Allan

  • tacman1123tacman1123 Posts: 168Questions: 39Answers: 1

    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!

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    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

  • alhuber1502alhuber1502 Posts: 9Questions: 3Answers: 0

    I'm curious if this has been implemented already? Thanks!

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    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

  • alhuber1502alhuber1502 Posts: 9Questions: 3Answers: 0

    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.

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    The SearchPanes rewrite is likely several months away at this point I'm afraid.

    Allan

  • alhuber1502alhuber1502 Posts: 9Questions: 3Answers: 0

    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!

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    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

Sign In or Register to comment.