Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. orders.controller('OrdersCtrl', function ($scope, $http, $rootScope, $location, $notification, $routeParams) {
  2.  
  3. // this works
  4. $scope.initGrid = function () {
  5. $scope.gridData = new kendo.data.ObservableArray([
  6. { artist: "Pink Floyd", track: "The dark side of the Moon" },
  7. { artist: "The Beatles", track: "I've just seen a face" },
  8. { artist: "Queen", track: "Innuendo" }
  9. ]);
  10.  
  11. $scope.gridColumns = [
  12. { field: "artist", title: "Artist" },
  13. { field: "track", title: "Track" }
  14. ];
  15.  
  16. };
  17. // this does not working
  18. $scope.update = function() {
  19. $scope.gridData[0].set("track", "Hey you");
  20. };
  21.  
  22. });
  23.  
  24. <button kendo-button ng-click="update()">
  25. Update from code
  26. </button>
  27.  
  28. TypeError: Cannot read property '0' of undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement