I create a disabled DropDownList with the following code:
<kendo-dropdownlist
for
=
"FreezeVM.Year"
class
=
"form-control"
datatextfield=
"Text"
datavaluefield=
"Value"
height=
"290"
enable=
"false"
bind-to=
"Model.YearList"
>
</kendo-dropdownlist>
Based on another DropDownList I change the value of this list:
function
onTargetTypeChange(e) {
var
targetValue =
this
.value();
var
currentYear =
new
Date().getFullYear();
var
yearDrop = $(
"#FreezeVM\\.Year"
).data(
"kendoDropDownList"
);
if
(targetValue ===
"6"
|| targetValue ===
"7"
) {
yearDrop.value(currentYear + 1);
}
else
{
yearDrop.value(currentYear);
};
};
The change is reflected on the UI, but not on the underlying Model which still has the old value. As soon as I enable the DropDownList everything works fine. What I expect is that the value gets changed no matter if the dropdown is enabled or disabled.
Regards
Heiko