This is Kendo ASP MVC though the question is about DataSource.
Our code has two dropdowns. When the `onchange()` for the first fires it calls `$("#classDropDown").data("kendoDropDownList").dataSource.read();` to force the second one to update.
<%: Html.Kendo().DropDownList().Name("speciesDropDown")
.DataTextField("Text")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetNLSSpecies", "RefData").Data("noFilters");
});
})
.HtmlAttributes(new { style = "width: 50%" })
.Filter(FilterType.Contains)
%>
...
<%: Html.Kendo().DropDownList().Name("classDropDown")
.DataTextField("Text")
.DataValueField("Value")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetClassData", "RefData").Data("mergeData()");
});
})
.HtmlAttributes(new { style = "width: 50%" })
.Filter(FilterType.Contains)
%>
Elsewhere ...
$('#speciesDropDown').on('change', function (event) {
...
$("#classDropDown").data("kendoDropDownList").dataSource.read();
}
The `mergeData()` function is called to provide data from the Javascript to the server. The **problem** is that because I'm calling this as a function it is **NOT** called during the `dataSource.read()`. But it is called initially when the page first loads.
Obviously I could change this to `mergeData` (ie. not a function) but it is the simplest case. I'm actually trying to pass arguments, something like:
.Data("mergeData('getSpeciesDropdownObj','getShownOrRequired(\"OtherClass\")')")
This seems like a bug to me. Does it to you?
I originally posted this at https://stackoverflow.com/questions/48087808/mvc-kendo-grid-read-action-datafunction-not-called-on-a-forced-datasource-re and had a conversation about though the question didn't really get answered. (I have since been given a login so I can post here).