Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

ng-grid is not showing complete data #4

Open
AgDude opened this issue Nov 17, 2015 · 3 comments
Open

ng-grid is not showing complete data #4

AgDude opened this issue Nov 17, 2015 · 3 comments

Comments

@AgDude
Copy link
Contributor

AgDude commented Nov 17, 2015

From @deveshkumar303 on June 29, 2015 15:10

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.

Copied from original issue: angular-ui/ui-grid#3886

@AgDude
Copy link
Contributor Author

AgDude commented Nov 17, 2015

From @c0bra on June 29, 2015 15:34

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

@AgDude
Copy link
Contributor Author

AgDude commented Nov 17, 2015

From @deveshkumar303 on June 29, 2015 15:56

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.

@AgDude
Copy link
Contributor Author

AgDude commented Nov 17, 2015

From @deveshkumar303 on June 29, 2015 18:19

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant