I am trying to display my SharePoint list data in Kendo UI Grid using AngularJS. But getting only headers, no grid data.
Please help.
Below is my code:
Html Code
<div id="example" data-ng-app="KendoDemos">
<div data-ng-controller="MyCtrl">
<kendo-grid options="mainGridOptions"></kendo-grid>
</div>
</div>
**Code in App.js**
angular.module("KendoDemos", ["kendo.directives"])
.controller("MyCtrl", function ($scope) {
$scope.mainGridOptions = {
dataSource: {
type: "odata",
transport: {
read: _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/listdata.svc/Employees",
type:"json"
},
pageSize: 5,
serverPaging: true,
serverSorting: true
},
sortable: true,
pageable: true,
dataBound: function () {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
columns: [{
field: "FirstName",
title: "First Name",
width: "120px"
}, {
field: "LastName",
title: "Last Name",
width: "120px"
}, {
field: "Country",
width: "120px"
}, {
field: "City",
width: "120px"
}, {
field: "Title"
}]
};
});