document.getElementById("refresh").addEventListener("click", function () {
$.ajax({
type: 'GET',
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Customers/',
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function (data) {
if (data) {
//ArrWorkers = data;
listWorker.dataSource = data.d;
listWorker.fields = { text: 'CustomerID', value: 'ContactName' }
listWorker.itemTemplate = "<span>${CustomerID} - ${ContactName}</span>",
listWorker.dataBind();
// BooGotWorkers = true;
// DataLoaded();
}
else {
alert("error")
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert("error")
}
});
}); |