I am trying to test kendo grid in angular.js app. I am not able to load json to populate the grid. I keep hitting the error block in line 11 below. In my browser console, I see the file loading ok.
Any pointers would be greatly appreciated!
Any pointers would be greatly appreciated!
01.appControllers.controller('LogsGridCtrl', function($scope, $http) {02. var ds = new kendo.data.DataSource({03. transport: {04. read: function(options) {05. $.ajax({06. url: "data/logs.json",07. dataType: "jsonp", 08. success: function(result) {09. options.success(result);10. },11. error: function(result) {12. console.log('error loading logs');13. options.error(result);14. }15. });16. }17. },18. pageSize: 10,19. schema : {20. data: "sudo", 21. parse : function(d) {22. for (var i = 0; i < d.length; i++) {23. if (d[i].sudo) {24. return d[i].sudo;25. }26. }27. return [];28. }29. }30. 31. });32. $scope.handleChange = function(data, dataItem, columns) {33. $scope.data = ds;34. $scope.columns = columns;35. $scope.dataItem = dataItem;36. };37. 38. $scope.gridOptions = {39. dataSource: ds,40. selectable: "row"41. };42. 43.});