Hello,
I use a PopupEdit Template with cascading DropDownLists and in th second DropDownList a serverfilter (see code)
the problem is, that the template is loaded on grid load and the second DropDownList does'nt work because the value of the
field $("#Fachgruppe_Version_ID").val() in the template is not set at this time...
- how to solve this problem?
- I know that there is a onEdit event from the grid but how to call scripts in the template?
- what's the best way to use Javascript/JQuery in the template (View Components, partial views)?
robert
@(Html.Kendo().DropDownListFor(model => model.Fachgruppe_ID)
.DataTextField("Fachgruppe")
.DataValueField("Fachgruppe_ID")
.BindTo((IEnumerable) ViewData["Fachgruppe"])
.HtmlAttributes(new {style = "width:500px"})
.CascadeFrom("Sparte_ID")
)
@(Html.Kendo().DropDownList()
.Name("FG")
.HtmlAttributes(new {style = "width:100%"})
.OptionLabel("Select product...")
.DataTextField("Fachgruppe")
.DataValueField("Fachgruppe_ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("FachgruppeVersion_Read", "Home")
.Data("filterFachgruppe");
})
.ServerFiltering(true);
})
.Enable(true)
.AutoBind(false)
.CascadeFrom("Sparte_ID")
)
<
script
>
function filterFachgruppe() {
return {
version_id: $("#Fachgruppe_Version_ID").val()
};
}
</
script
>