The code below throws a Javascript error that the function filter can not be found. Its defined right below the control. Why can't it be found?
@(Html.Kendo().ComboBoxFor(m=>m.childId)
.HtmlAttributes(new { style = "width:100%;" })
.Placeholder("Select ...")
.DataTextField("description")
.DataValueField("id")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("getData", "controller1")
.Type(HttpVerbs.Get)
.Data("filter");
})
.ServerFiltering(true);
})
.AutoBind(true)
)
<script>
function filter() {
return {
id: $("#Id").data("kendoComboBox").value()
}
}
</script>
@(Html.Kendo().ComboBoxFor(m=>m.childId)
.HtmlAttributes(new { style = "width:100%;" })
.Placeholder("Select ...")
.DataTextField("description")
.DataValueField("id")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("getData", "controller1")
.Type(HttpVerbs.Get)
.Data("filter");
})
.ServerFiltering(true);
})
.AutoBind(true)
)
<script>
function filter() {
return {
id: $("#Id").data("kendoComboBox").value()
}
}
</script>