Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Show list items in AngularJS ng-grid

$
0
0

retrieving SharePoint list items by REST with

var app = angular.module('myApp', ['ngGrid']);

    app.controller('MyCtrl', function ($scope, $http) {

        $http.get('http://whereever/_api/web/lists/getByTitle("Tasks")/items').success(function (data) {
            $scope.items = data;
        });

        $scope.gridOptions = {
            data: 'items',
            columnDefs: [
            { field: 'Title', displayName: 'Title' },
            { field: 'Status', displayName: 'Status' }
            ]
        };
    });

the ng-grid on

<div ng-controller="MyCtrl"><div class="gridStyle" ng-grid="gridOptions"></div></div>

just shows nothing. A simple json example like  http://plnkr.co/edit/UndbtO?p=preview works. Is there any example showing me how to use a REST call on a SharePoint list and passing data to ng-grid?


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>