Hi John,
Thanks for contacting Syncfusion Support.
We were unable to reproduce the console error, "Uncaught ejDropDownList: methods/properties can be accessed only after plugin creation" at our end. We have prepared a sample for cascading two DropDownListFor controls. Have a look at the below code snippet.
View Code:
<div class="col-xs-8 col-sm-4">
<span class="txt">Select Group</span>
@Html.EJ().DropDownListFor(model => model.auto1, (Syncfusion.JavaScript.Models.DropDownListProperties)ViewData["ddl"]).CascadeTo("Name").ClientSideEvents(e => e.Change("onChange")).WatermarkText("Select")
</div>
<div class="col-xs-8 col-sm-4">
<span class="txt">Select Country</span>
@Html.EJ().DropDownListFor(model => model.Name, (Syncfusion.JavaScript.Models.DropDownListProperties)ViewData["ddl1"]).Enabled(false)
</div>
<script type="text/javascript">
function onChange() {
var ctry = $('#Name').data("ejDropDownList");
ctry.element.val("");
}
</script> |
Controller Code:
public ActionResult DropdownlistFeatures()
{
DropDownListProperties ddl = new DropDownListProperties();
ddl.DataSource = GetDataSource();
DropDownListFields ddf = new DropDownListFields();
ddf.Text = "text";
ddf.Value = "parentId";
ddl.DropDownListFields = ddf;
ViewData["ddl"] = ddl;
DropDownListProperties ddl1 = new DropDownListProperties();
ddl1.DataSource = GetDataSource1();
DropDownListFields ddf1 = new DropDownListFields();
ddf1.Text = "text";
ddf1.Value = "value";
ddl1.DropDownListFields = ddf1;
ViewData["ddl1"] = ddl1;
return View();
} |
If the issue still persists, please provide an issue reproducing sample along with the replication steps. It will help us to isolate the root cause and provide a solution.
Regards,
Prince