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 Element getValue() should get object when options is populated with Objects (Enhancement) #302

Open
reynardmc22 opened this issue Mar 10, 2017 · 1 comment

Comments

@reynardmc22
Copy link

There doesn't appear to be a way to access the Object in Options if it's populated with a list of Object thru the API. It would seem to make sense that getValue() return the object instead of the text value of the Object. Or have an API method to getOption(value) or getSelectedOption or whatever name would make the most sense.

@mkozhukh
Copy link
Member

mkozhukh commented May 4, 2017

For richselect, combo and similar controls you can use the next code to access the selected object

var value = combo.getValue();
var obj = combo.getList().getItem(value);

For the "select" control, there is no easy way to obtain the original object. We will consider extending getValue API ( default behavior will not change, getValue will return the selected value by default )

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

3 participants