0

How to bind selected value of dropdown in metro style app using data-win-bind

 <select class="win-interactive itemCount" data-win-bind="itemKey: key; selected: quantity; selectedValue: quantity; value: quantity;" >
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                        <option>5</option>
                    </select>
2
  • Are you trying to bind setting the value on the select element, or are you expecting it to be a two way binding? (e.g. when the user changes their value, it sets back on your data object?) Commented Sep 7, 2012 at 15:17
  • it is only one way. binding value on the select element. Commented Sep 8, 2012 at 1:53

1 Answer 1

2

Use repeater on the select tag and bind it to list of values and content:

<select id="repeater" data-win-control="WinJS.UI.Repeater">
    <option data-win-bind="value: Val; textContent: Content"></option>
</select>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.