Skip to content
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

Select option text manipulation after selected #1642

Closed
akayueh opened this issue Oct 11, 2020 · 5 comments
Closed

Select option text manipulation after selected #1642

akayueh opened this issue Oct 11, 2020 · 5 comments

Comments

@akayueh
Copy link

akayueh commented Oct 11, 2020

Hi

I am trying to work out how to do this... here are my structure:

<optgroup label="Microsoft">
<option value="microsoft-usa">USA</option>
<option value="microsoft-usa-alabama">Alabama<option>
<option value="microsoft-usa-alaska">Alaska<option>
</optgroup>

<optgroup label="Apple">
<option value="apple-usa">USA</option>
<option value="apple-usa-alabama">Alabama<option>
<option value="apple-usa-alaska">Alaska<option>
</optgroup>

As you can see both "Microsoft" and "Apple" share the same geo-locations in their list, but when say I selected the "USA" for both of outgroup, the selected item simply says "USA", and there is no way to identify which company it belongs too.

Is there a way for me to manipulate the option label or display text after an item been selected, so it somehow displays something like "Microsoft - USA" and "Apple - USA"? I think "data-on-item-select" event only trigger after the item been moved?

@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/olton/Metro-UI-CSS

@akayueh akayueh changed the title option Text Manipulation after selected Select option text manipulation after selected Oct 11, 2020
@akayueh
Copy link
Author

akayueh commented Oct 13, 2020

I am also throw in another suggestion, that when a cascading option been presented, there can be an option to remove all the sub-level options.

For example, if someone selects the country USA, all the States under USA should be removed as the top tier already cover the selection...

olton added a commit that referenced this issue Oct 19, 2020
… **false**), `data-short-tag=true|false` (default - **true**), issue #1642
@olton
Copy link
Owner

olton commented Oct 19, 2020

In 4.4.1. I'm added
Select: added attributes data-show-group-name="true|false" (default - false), data-short-tag="true|false" (default - true)

Example: https://codepen.io/olton/pen/oNLLENZ

@olton
Copy link
Owner

olton commented Oct 19, 2020

I am also throw in another suggestion, that when a cascading option been presented, there can be an option to remove all the sub-level options.

For example, if someone selects the country USA, all the States under USA should be removed as the top tier already cover the selection...

Work with cascading values is not planned in the near future.

@olton olton added this to the 4.4.1 milestone Oct 19, 2020
@olton olton closed this as completed Oct 19, 2020
@akayueh
Copy link
Author

akayueh commented Nov 5, 2020

Hi @olton

Here is a quick sample of the function I described, maybe you can consider it. It is not the best code, just something quick and simple to illustrate.

https://codepen.io/akayueh/pen/rNLdeYE

olton added a commit that referenced this issue Oct 28, 2023
… **false**), `data-short-tag=true|false` (default - **true**), issue #1642
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants