I've searched, but can't seem to make the above combination work. JSON data is being returned from WebAPI?
Any help would be appreciated
Hello Jeff,
Thank you for contacting Infragistics! I have some questions concerning this matter:
How are you setting up the grid? Have you checked to see if your WebAPI is properly returning data? Do you get any errors? Do any errors or messages appear in the console? You can check this by opening the dev tools (F12) then going to the console tab and refreshing your page.
I am using igGrid as a Directive; basically your online sample i.e., Have you checked to see if your WebAPI is properly returning data - well I believe that is really the question "properly returning data"; and well my JSON object does contain data using the dataService.js your example file found online, see below.
<ig-grid id="homesGrid" data-source="homes" width="100%" auto-commit="true" auto-generate-columns="false" event-rendered="homesGridRendered"> <columns> <column key="CommunityName" header-text="Address" data-type="string"></column> </columns> <features> <feature name="Sorting" event-column-sorted="homesGridColumnSorted"></feature> <feature name="Selection" event-row-selection-changed="homesGridRowSelectionChanged"></feature> <feature name="Paging" page-size="5" event-page-size-changed="homesGridPageSizeChanged" event-page-index-changed="homesGridPageSelectionChanged"></feature> </features> </ig-grid>
app.factory('dataService', ['$http', '$q', function($http, $q){ 'use strict'; var svc = { getAll: function(){ var deferred = $q.defer(); $http.get("http://localhost:81/sfhl_api/").success(deferred.resolve).error(deferred.reject); return deferred.promise; }, }; return svc;
}]);
AND YOUR masterDetailCtrl:
dataService.getAll().then(function (homes) { var x2 = [{ "CommunityName": "c1" }];
$scope.homes = homes; }, function (error) { $scope.error = error; });
Are you getting any errors when you run the page? Can you check the console for errors? You can do so by opening the dev tools (F12) and switching to the console then refresh the page.
I'm attaching a sample which demonstrates the igGrid + Angular + WebAPI combination.
Hope this helps,Martin PavlovInfragistics, Inc.
I am following to see if the sample Martin has provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Hello, the example was very helpful. Is it possible to realize inline editing/updating, delete etc. features in a project like this?
When I enable the updating behavior...how can I tell it which webAPI method to use for updating etc?