This is a migrated thread and some comments may be shown as answers.

Two-way binding to an HTML select element

2 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 14 Oct 2014, 09:24 PM
I seem to be having problems getting the select to update when I change the item in the underlying observable array (the select's source).  If I add a new item, it appears in the list and looks correct; however, if I edit the name of an item I can't get it to change unless I rebind the viewmodel to the view.

Here is an example:
http://jsfiddle.net/MadCodeMonkey/u8quqvtd/

Is this expected behavior?

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 16 Oct 2014, 04:00 PM
Hello Dave,

For performance reasons, the option elements will not be bound by default. The binding can be enabled by specifying a template. I updated the jsFiddle to demonstrate using a template to bind the select options.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Dave
Top achievements
Rank 1
answered on 16 Oct 2014, 07:06 PM
That worked.  Thank you.  
Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Dave
Top achievements
Rank 1
Share this question
or