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?
<
script
type
=
"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
>
<
div
data-bind
=
"source: data"
data-template
=
"totalAmountTemplate"
></
div
>