I'm updating my dropdown's datasource by calling DDL.data("kendoDropDownList").dataSource.read();
This partially works, it executes the server side read event, but it does not execute the JS function which should dynamically get the parameters for the server side read event. The function assigned in .Data [see below] (GetAllDescriptorsData) only executes once - when the page loads, it does not re-execute when . call read() [see above].
My question is, How can I force a read and get new parameters?
@(Html.Kendo().DropDownList()
.Name(YearDescriptorID)
.DataSource(source =>
{
source.Read(read =>
{
var IsSpouse = Model.IsSpouse ? "1" : "0";
read.Action("GetAllDescriptors", "Income").Data("GetAllDescriptorsData("+ Model.PersonalKey + "," + IsSpouse + ")");
})
.ServerFiltering(true);
})
.AutoBind(false)
.DataTextField("DisplayText")
.DataValueField("IncomeKey")
.Events(e =>
{
e.Change("onChangeYearDescriptor");
e.DataBound("onDataboundYearDescriptor");
})
)