ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

ng-grid is not showing complete data

Open deveshkumar303 opened this issue 11 years ago • 5 comments

Hi,

i am using below code to populate my grid using service response.

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

app.controller('bodyController', ['$scope', '$http', '$domUtilityService', function ($scope, $http, $domUtilityService) {
    //debugger;
    /*
    $scope.myData = [{ name: "Moroni", age: 50 },
                     { name: "Tiancum", age: 43 },
                     { name: "Jacob", age: 27 },
                     { name: "Nephi", age: 29 },
                     { name: "Enos", age: 34 }];
    $scope.gridOptions = { 
        data: 'myData'
    };
    */

    $scope.GridDetails = [];


    $http.get('http://localhost:342345/api/FlexiData/GetData')
    .success(function (Griddata, status, headers, config) {
        //debugger;
        $scope.GridDetails = angular.fromJson(Griddata);

    })
    .error(function (data, status, headers, config) {
        //debugger;
        alert("error");
    });

    $scope.gridOptions = {
        data: 'GridDetails'
    };

    $domUtilityService.RebuildGrid;

}]);

My grid is only showing 6 rows only but in actual 'Griddata' has 500+ rows. I have included following JS files in my code. http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid-flexible-height.min.js https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.css https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid-layout.min.js

Please help me, where i am doing mistake.

deveshkumar303 avatar Jun 29 '15 15:06 deveshkumar303

Should $domUtilityService.RebuildGrid; be $domUtilityService.RebuildGrid();?

c0bra avatar Jun 29 '15 15:06 c0bra

I tried below two statement one by one

  1. $domUtilityService.RebuildGrid();
  2. $domUtilityService.RebuildGrid($scope.gridOptions.$gridScope, $scope.gridOptions.ngGrid);

after applying above two statement, it is stop showing any data on Grid.

deveshkumar303 avatar Jun 29 '15 15:06 deveshkumar303

I used ng-style="{height: (gridOptions.data.length*30)+32+'px'} style sheet in the grid. it start showing me few more ROWS, but still it is not showing complete data and it make grid slow as well.

deveshkumar303 avatar Jun 29 '15 18:06 deveshkumar303

This issue was moved to angular-ui/ng-grid-legacy#4

AgDude avatar Nov 17 '15 16:11 AgDude

I was facing any issue with ng-grid column width not adjusting automatically

msuresh551 avatar Aug 23 '19 10:08 msuresh551