Hi,
I need your help
I have a form of 3 combobox and I want to load them in cascade on your page, but when loading a lot of information in the combobox, the page is encouraged
There is some way to do the first load of the combobox and then with the onchange event do the second load of the second combobox and so on, so that the load is only used when needed and not load the 3 combobox from the start
Regards!
|
<code>
<ejs-combobox id="state" enabled="false" placeholder="Select a state" allowCustom="false" change="statechange">
<e-combobox-fields text="stateName" value="stateId"></e-combobox-fields>
</ejs-combobox>
var state = document.getElementById('state').ej2_instances[0];
state.dataSource = @Html.Raw(Json.Serialize(ViewBag.state));
state.dataBind();
</code> |
|
<code>
<ejs-combobox id="city" placeholder="Select a city" enabled="false" allowCustom="false"popupHeight="@ViewBag.popupHeight" >
<e-combobox-fields text="cityName" value="cityId"></e-combobox-fields>
</ejs-combobox>
</code> |
|
<code>
var city = document.getElementById('city').ej2_instances[0]; // Control instance
// for an example
$.ajax({
Success: function(args) {
city.dataSource = args.result;
city.enabled = true;
}
})
</code> |