Zholen
Zholen

Reputation: 1790

How to choose specific value in select box with knockout

here's a fiddle of what i've got:

http://jsfiddle.net/3LHBL/1/

How can I reset the second dropdown once its been repopulated to choose either the first item or one that I designate from elsewhere?

Example:

  1. User looks at 'abc' '5'
  2. User changes to 'def' -> second select should choose value =='20' || first option

Upvotes: 0

Views: 92

Answers (1)

Michael Best
Michael Best

Reputation: 16688

You can make it choose a new option by setting selectedEvent right after you set the new events list. Here's an example: http://jsfiddle.net/mbest/3LHBL/2/

Setting the first option would be done similarly: http://jsfiddle.net/mbest/3LHBL/3/

Upvotes: 2

Related Questions