Hi Manolo,
Thanks for contacting Syncfusion support.
In URL databinding, data request will be raised to server based on the query it will return the data but, assigned viewbag data is a local data. Local data query processed internally and it will be shown in the data for corresponding item. In URL databinding, you should execute the query based on the parent dropdown list selection.
Please refer to the code snippet:
<code>
@Html.EJ().DropDownList("groupsList2").Datasource(ds => ds.URL(@Url.Content("~") +"Dropdownlist/GetGroupsJson").Adaptor(AdaptorType.UrlAdaptor)).DropDownListFields(f => f.Value("parentId").Text("text")).CascadeTo("countryList2").EnableRTL(false).ClientSideEvents(obj => obj.Cascade("dropcascade"))
</code> |
<code>
<script type="text/javascript">
function dropcascade(args) {
args.cascadeQuery = ej.Query().where(args.model.fields.value, "==", args.cascadeValue);
}
</script>
</code> |
<code>
public JsonResult GetCountriesJson(Syncfusion.JavaScript.DataManager dm)
{
Syncfusion.JavaScript.DataSources.DataOperations operation = newSyncfusion.JavaScript.DataSources.DataOperations();
return Json(operation.Execute(GetCountries(), dm));
}
</code> |
Regards,
Karthikeyan V.