webix-hub / webix

Stable releases of Webix UI - JavaScript library for building mobile and desktop web apps

Home Page:http://webix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select Element getValue() should get object when options is populated with Objects (Enhancement)

reynardmc22 opened this issue · comments

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.

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 )