On the same topic,
I have a cascading dropdownlist
@(Html.Kendo().DropDownListFor(m => m.EventTrigger.TriggerType)
.Name("DeviceInterfaces")
.OptionLabel("Select interface...")
.DataTextField("Name")
.DataValueField("Id")
.DataSource(source => source.Read(read => read.Action("GetCascadeDeviceInterfaces", "EventTriggers")))
)
@(Html.Kendo().DropDownListFor(m => m.EventTrigger.TriggerId)
.Name("EventTrigger.TriggerId")
.OptionLabel("Select item...")
.DataTextField("Id")
.DataValueField("Name")
.DataSource(source => source.Read(read => read.Action("GetCascadeIdsByInterface", "EventTriggers")
.Data("filterInterface"))
.ServerFiltering(true))
.Enable(false)
.AutoBind(false)
.CascadeFrom("DeviceInterfaces")
)
<script>
function filterInterface() {
return {
deviceInterface: $("#DeviceInterfaces").val()
};
}
</script>
Now, the above works fine, except, like I mentioned in my first post, in order for me to bind the selected value of my dropdownlist to my model, I somehow need to set the my model property as the .Name() property.
So what I did, was to change (in my first dropdownlist)
.Name("DeviceInterfaces")
to
.Name("EventTrigger.TriggerType")
and in my second dropdownlist, I changed
.CascadeFrom("DeviceInterfaces")
to
.CascadeFrom("EventTrigger.TriggerType")
And finally, in the script
<script>
function filterInterface() {
return {
deviceInterface: $("#DeviceInterfaces").val()
};
}
</script>
to
<script>
function filterInterface() {
return {
deviceInterface: $("#EventTrigger.TriggerType").val()
};
}
</script>
However, this has caused the cascading effect of the 2nd dropdown to stop functioning. Selecting any item in my first dropdown, doesn't update the 2nd cascading dropdownlist.
Please help.
Maybe I might have missed something somewhere