Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Is it possible to change the selectItem text formatting?

    Consider the following image:
    Click image for larger version

Name:	Screenshot 2021-11-18 at 09.25.22.png
Views:	18
Size:	47.8 KB
ID:	266871
    In a multiple-select SelectItem, the actual text of what is selected quickly becomes useless IMO. I would like it to instead say for example "X items selected", but i cannot see any way to do it.

    I tried the ValueFormatter, but that only changes each individual selected item text (the 'Item 0', 'item 1' etc.)
    i would like to control the entire contents. I tried setting the 'value' in a ChangeHandler too, but that interferrred with the selection.

    Is this possible?

    #2
    Hi Mathias, unfortunately, we do not currently have an API that allows you to control the overall format (in fact we focused our effort on making sure that formatters worked on each individual item in a multi-select, as that's usually desired).

    Also, while we do see the value of showing the number of items selected, we don't think it necessarily makes sense as a complete replacement of the list of items. Even if the overall list is too long to read, it would often be useful to know the first, second, third items - whatever fits.

    So a few options:

    1. you could show the number of items externally to the control, as a dynamically updated hint, adjacent BlurbItem, or in some other way such as a hover

    2. you could use the existing per-value formatting option to add the overall count of items to the formatting for the first item (perhaps only if there are 3+ items selected, or whatever is unlikely to fit). So it would read like: "3 selected: item 1, item 2, item 3, ...". Here again, consider that your end users may value knowing the first and second items selected over knowing the overall count - a very app-specific thing, of course.

    3. if neither of the above work, we could add a new API, via Feature Sponsorship, if you want to control the overall format instead of the format of individual items

    Comment

    Working...
    X