Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

How to bind value to multiple dropdowns (html select) within a template?

$
0
0

Hi, I have this viewModel, that I want to bind values with the dropdowns inside a template.

But I cannot bind the value 1, 3, 5 to the dropdowns, i.e. the selected value of the html selects.

 Could you please help with this?

<scripttype="text/x-kendo-template"id="totalAmountTemplate">
# for (int i = 0; i < values.length; i++) { #
<select data-bind="value: values[i]">#
for (int j = 0; j < values.length; j++) { #
<option>#= j #</option># } #</select>
# } #
</script>
<script>
var viewModel = kendo.observable({   
    data: { values: [1, 3, 5] }
});
kendo.bind(document.body.children, viewModel);
</script>
<divdata-bind="source: data"data-template="totalAmountTemplate"></div>

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>