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

Proposal: Component to bind enum properties to select/option #13

Open
ScraM-Team opened this issue Jan 15, 2019 · 2 comments
Open

Proposal: Component to bind enum properties to select/option #13

ScraM-Team opened this issue Jan 15, 2019 · 2 comments

Comments

@ScraM-Team
Copy link
Contributor

I think Flavour would benefit from a new component that automatically populates a select with enum value options, and binds the select to an enum value in the view class.

This can be done manually, but it involves several steps:

  • Showing the values can be done manually using std:foreach iterating over the enum values.
  • The property value can be bound via the 'select' attribute of the option
  • Bidirectional binding can handle change events to set the value back to the property in the view class.
@konsoletyper
Copy link
Owner

See the example.

@ScraM-Team
Copy link
Contributor Author

I'm trying out the bidirectional binding, thanks for showing me that.

I think a neat enhancement would be to automatically generate the elements from the enum values. Adding spaces in between camel-cased words could work for the displayed names. I'll see if I can come up with a reusable component.

@ScraM-Team ScraM-Team changed the title Proposal: Component to bind enum properties to select/option Proposal: Component to bind enum properties to select/option [GSoC?] Feb 12, 2019
@ScraM-Team ScraM-Team changed the title Proposal: Component to bind enum properties to select/option [GSoC?] Proposal: Component to bind enum properties to select/option Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants