How to get value
of the Webix ui.radio option? The getValue()
method returns only ID os the selected one, as well as the first parameter in onChange
. Is this possible at all? Thanks.
The sample:
{
view:"radio",
label:"uiRadio",
options:[
{ id:1, value:"Test 1"},
{ id:2, value:"Test 2"},
{ id:3, value:"Test 3"}
],
on:{ onChange:function(newV){
webix.message(this.getValue()+" "+newV)
}}
}
It's not pretty but this is what I came up with:
webix.ui({
view:"radio",
label:"uiRadio",
options:[
{ id:1, value:"Test 1"},
{ id:2, value:"Test 2"},
{ id:3, value:"Test 3"}
],
on:{ onChange:function(newV){
var textValue = this.data.options
.filter(function(el) {return el.id == newV})
[0].value
webix.message(newV + ": " + textValue)
}}
});