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

[DataBind] Add support for casting value when accessing it #266

Open
Tracked by #170
titouanmathis opened this issue Jul 17, 2024 · 1 comment
Open
Tracked by #170

[DataBind] Add support for casting value when accessing it #266

titouanmathis opened this issue Jul 17, 2024 · 1 comment

Comments

@titouanmathis
Copy link
Contributor

The DataBind component does not have yet a special handling of values, except for checkboxes and selects.

It could be useful to be able to define the type of the value that should be returned when invoking the get() method or reading the value property.

If we are dealing with inputs of type number for example, it can not be used as follows:

dataBindInstance.value += 1;
@titouanmathis
Copy link
Contributor Author

We have 2 options :

  • add a type option to the components, allowing to specify the type of a group manually
  • add valueAsNumber, valueAsBoolean, etc. getters and setters to be able to use them only where needed without having to configure the type everywhere

@titouanmathis titouanmathis mentioned this issue Sep 17, 2024
15 tasks
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

1 participant