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?
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?