function populateLocation(areaId) { var locationdropDownlist = $('#JobLocationId').data("ejDropDownList"); if (areaId != '') { jQuery.post("@Url.Action("GetSelectList", "SelectList")", { entityType : 'JobLocation', field : 'AreaRefId', value : areaId }, function (data) {
//bind the data here .... ??
},
"json");
}
}
I have gone through the Essential JavaScript API Reference - v.13.1.0.30 but I don't find any javascript method that will allows me to do so ... please help by providing sample of how to achieve it.
Thanks
Regards
SK
Hi SK Yong,
Thanks for using Syncfusion Products.
We have achieved your requirement “Dynamically bind the data to ejDropDownlist on ajax call” and please find the sample under the following location,
Sample: DropDown Sample
In this above sample, we have bind the data to the dropdown list on ajax call by using the property “dataSource” and please find the code for the same,
<code>
<script>
function onClick() {
$.ajax({
url: '/DropDown/Add',
type: 'POST'
}).success(function (result) {
BikeList = [
{ empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" },
{ empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" },
{ empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" },
{ empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" }
];
var data1 = $("#bikeList").data("ejDropDownList");
data1.option("dataSource", BikeList);
})
}
</script>
</code>
Please let us know if you have any further assistance,
Regards,
Kasithangam
Hi SK Yong,
Thanks for your update.
Please get back to us if you have further queries.
Regards,
Kasithangam
Scenarios 2: using references as a Enum DropDown
Thanks