Skip to content

Problem in ng grid column expansion if more than one grid in a page #2330

@ksrdhilip

Description

@ksrdhilip

The problem is, if have a more than one grid in same page/scope and the grids are having different columns (E.g, Grid1: column1, column2, etc., Grid2: Grid2_Column1, Grid2_Column2). On clicking on the second grid’s (Grid2) second column (Grid2_Column2), it is setting the width as per the first grid’s (Grid1) second column(column2). So the column width is not set as per the header text/content text width of the second column in grid 2.

This is because, the resizeOnData function in ng-grid to expand the column based on the header/content text width. In $utils.getElementByClassName(‘col’+col.index) is fetching the element based on the css classname(col1) and in my case the same css class is applied for both the grids. So, its fetching the first grid’s text and setting the width.

Can someone help me in fixing this problem?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions