- Home
- Forum
- ASP.NET MVC
- bind Syncfusion dropdownlist via json result on ajax call
bind Syncfusion dropdownlist via json result on ajax call
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
Scenario 1:
using a reference or Foreign Key table.
For e.g. if Customers had a FK key to Orders table,
- would it be possible to select the orders as the drop down
- would it possible to select the orders that are not already selected on the current page
Scenarios 2: using references as a Enum DropDown
Thanks
for e.g. inside a [Orders table] (FK to Country), user is selecting Country and then State (FK to Country)

Since every Table row is different and my DropDownId are different in each row, I dont know how to find/filter based on the selected country in the DLL and and then filter the state, can you help me
I have to filter the states based on country selected, and I want to make it easy for me to reuse and efficient.
I have 2 other tables that I do this, so understanding this will help me reuse it.
thanks
- 11 Replies
- 5 Participants
-
SY SK Yong
- Jun 5, 2015 09:06 PM UTC
- Mar 13, 2017 04:44 PM UTC