Even though many similar topics can be found on the internet, I wasn't able to bind my dropdownlist value within a scheduler template:
this is my code within the template:
<div class="k-edit-label"><label for="trainerId">Trainer</label></div>
<div data-container-for="trainerId" class="k-edit-field">
<input id="trainerId" name="trainerId"
data-bind="value:trainerId"
data-role="dropdownlist" />
</div>
the dropdownlist is beeing created by edit event of scheduler:
// Creating dynamic dropdown
e.container.find("#trainerId").kendoDropDownList({
dataTextField: "Text",
dataValueField: "Value",
change: function(e) {
},
dataSource: {
transport: {
read: {
type: 'post',
dataType: "json",
url: '@Url.Action("Trainers_List","Trainer")',
}
}
}
});
Fiddler shows :
'TrainerId' is listed in the body but has no value.
Instead there are other fields like:
trainer.Disabled,
trainerId.Sorting,
trainerId.Value which actually holds the correct value.
What am I doing wrong here?