Two-way binding to an HTML select element

3 posts, 1 answers
  1. Dave
    Dave avatar
    15 posts
    Member since:
    Aug 2013

    Posted 14 Oct 2014 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    2230 posts

    Posted 16 Oct 2014 Link to this post

    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!
     
  3. Dave
    Dave avatar
    15 posts
    Member since:
    Aug 2013

    Posted 16 Oct 2014 in reply to Daniel Link to this post

    That worked.  Thank you.  
Back to Top