this.data = new DataManager({
url: 'https://services.odata.org/V4/Northwind/Northwind.svc',
adaptor: new ODataV4Adaptor,
crossDomain: true,
}).executeQuery(new Query().from('Employees').select('EmployeeID,FirstName,Title').take(5))
.then((e: any) => {
if (e.result[0] && e.result[0].HasErrors) {
console.error("Error occurred: ", e.result[0].ErrorCode)
return;
}
//sample data received from remote service
e.result = [
{ "EmployeeID": 1, "FirstName": "John", "hasChildren": true, "expanded": true },
{ "EmployeeID": 2, "parentID": 1, "FirstName": "Stephen" },
{ "EmployeeID": 3, "parentID": 1, "FirstName": "Andrea" },
{ "EmployeeID": 4, "parentID": 1, "FirstName": "Jessy" }
];
this.field = { dataSource: e.result, id: 'EmployeeID', text: 'FirstName', hasChildren: 'hasChildren', parentID: 'parentID', expanded: "expanded" }
});
|