Skip to Content
0
Former Member
May 18, 2015 at 06:41 PM

Binding selected item key of a select to model property

72 Views

I have a Select like this one:

<Select

type="IconOnly"

icon="{

path: 'myModel>baz',

formatter: 'myFormatter'

}">

<core:ListItem

key="foo"

text="Foo"/>

<core:ListItem

key="bar"

text="bar"/>

</Select>


And a model "myModel" with a property "baz" that I want to bind the selected item key to. To be clearer, I want the property "baz" to contain "foo" or "bar", when the respective item has been selected.

I need a different icon to be shown when "foo" or "bar" is selected. Right now, if the model is changed properly, it works just fine. But the binding needs to work for that to work.