Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting height: 100% causes the grid to load and render all data. #878

Closed
johnib opened this issue May 4, 2016 · 5 comments
Closed

Setting height: 100% causes the grid to load and render all data. #878

johnib opened this issue May 4, 2016 · 5 comments

Comments

@johnib
Copy link

johnib commented May 4, 2016

Hello,

I have an object with around 20K results, which initializes the grid as follows:

<div ag-grid="gridOptions" class="ag-fresh" style="height: 100%;"></div>

$http.get('data.json')
    .then(function (res) {
        return transformResults(res.data);
    })
    .then(function (defs) {
        $scope.gridOptions.api.setColumnDefs(defs.columnsDef);
        $scope.gridOptions.api.setRowData(defs.rowsDef);
    });

The Chrome browser crashed while rendering the grid (the transform function took ~200ms).
But when I've set:

<div ag-grid="gridOptions" class="ag-fresh" style="height: 850px;"></div>

it worked blazing fast.
Yet, I need to set the height to 100% of the div containing the grid's element.

Am I using this in the wrong way or is it a bug?

@ceolter
Copy link
Contributor

ceolter commented May 4, 2016

it's usually a CSS issue for you. the grid will fill the height of the div you give it. see the note on % height here:
https://www.ag-grid.com/javascript-grid-width-and-height/index.php

@ceolter ceolter closed this as completed May 4, 2016
@johnib
Copy link
Author

johnib commented May 4, 2016

Well, I'm using a clean angular 1 boilerplate for testing this.
There are no CSSs at all except for those of the grid.

If I set the grid's height to absolute pixel value, it initializes the grid with 20K results immediately.
Once, the grid's height is set in percentages (even 10%) the initialization time depends on the size of the input (with 20K results it's in minutes).

@ceolter
Copy link
Contributor

ceolter commented May 5, 2016

as i mentioned, its' your css. when you use %height, you have to be mindful of the height of the parent div also (especially if you don't set it). to get it working, drop the ag-grid bit (but leave the div in) and observe that your %height doesn't work as you think it does, the div will scroll way down your page.

@thearabbit
Copy link

has fixed already?
Pl share

@ralexand56
Copy link

Is there a way to troubleshoot this because I'm getting horrible performance and every parent has a height of 100% set.

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

No branches or pull requests

4 participants