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

Grid not rendering correctly when placed in bootstrap accordion

Open tuckerjt07 opened this issue 11 years ago • 2 comments

The ui-grid will not render data when placed in an accordion that is defaulted to close. I haven't had much chance to dig into it but it appears to be related to the display: none property of the collapse class. The grid can be forced to rerender by calling resize, whether that is using the $interval code snippet as suggested for modals, resizing the window, opening developer tools, etc. The issue with using the provided $interval snippet is the differences in the way modals and accordions are rendered on the page. For an accordion the $interval would need to run continuously the entire time the page was open. I'm not sure if there is a "real fix" for the issue but the simplest solution would be to provide an externalization of the $scope.gridApi.core.handleWindowResize() function. I have attempted to capture this function and call it from outside of onRegisterApi but it is always undefined. I do know that having the ability to call this function would force the grid to render when the accordion was expanded.

tuckerjt07 avatar Jul 31 '15 20:07 tuckerjt07

for ng-grid i think you need to call gridOptions.ngGrid.buildColumns(); for ui-grid you need to call gridApi.core.refresh();

JavaBasketball avatar Oct 21 '15 05:10 JavaBasketball

Closing as this is not a bug and is a bit old.

mportuga avatar Dec 14 '16 07:12 mportuga