if you want to load your kendoDropDownList from json we service you can follow this
script
service call
script
$('#Branchs').kendoDropDownList({
// optionLabel: "Select branch...",
dataTextField: "text",
dataValueField: "value",
change: function () {
e.model.BranchRef = this.text();
},
dataSource: {
transport: {
read: function (e) {
$.ajax({
url: 'http://localhost/Notifier/Branches/GetDropDown/token',
type: 'GET',
dataType: 'json',
success: function (data) {
{
e.success(data);
}
},
});
}
}
}
});
service call
[HttpGet]
[Route("GetAll/{SecurityToken}")]
public HttpResponseMessage GetAllBranches(string SecurityToken)
{
List<BranchDTO> Branches = BranchService.GetAllBranchDTO(database, false);
return Request.CreateResponse<List<BranchDTO>>(HttpStatusCode.OK, Branches);
}
Comments
Post a Comment