Column headers become fixed and out of sync on horizontal scroll
Column headers become fixed and go out of sync on horizontal scroll. I'm using the latest unstable release and Chrome 42x. Refer to the screenshot below.

Can you give more details on your grid setup so this can be reproduced, i.e. what features you have turned on/off (like filtering which I see), how many columns total, grid css, etc?
Even better, a plunker with the issue reproduced would be wonderful :)
I can't reproduce this consistently, but it happens quite frequently (I just couldn't figure out a pattern so far). I'm using ui-grid-selection and ui-grid-pinning on my grid. In the grid css, width and height are set to 100%, though it doesn't really expand the grid to 100% available screen height (that might be another issue). I have 12 columns in total. Needless to say, I have more columns than what can fit into the screen width and hence the need for horizontal scrolling. My grid has these options set on it.
selectedItems: [],
showGridFooter: false,
enableRowHeaderSelection: true,
multiSelect: false,
enableHorizontalScrollbar: 1,
enableVerticalScrollbar: 1,
enableFiltering: true,
enableSorting: true,
If you cannot reproduce it at all, let me know. I'll try to setup a plunker and see if I can reproduce it there.
Thanks to you and all the contributors for the awesome work!
After playing around a bit, I figured out that 2 things when combined cause the problem:
- Enable "ui-grid-selection".
- Have a div with ng-show around the div for the grid, like so:
<div ng-show="someobj.length > 0">
<div ui-grid="gridOptions" ui-grid-selection class="grid"></div>
<!-- some more content here -->
</div>
If I replace ng-show with ng-if, the issue goes away. The issue also goes away if I remove ui-grid-selection from the grid.
I removed every option from the grid, and brought it to down to just 2 columns with a single row of hard-coded data. See the screenshot below. When I first load the page, grid works just fine. But if I refresh the page using browser's refresh button, that's when the header gets frozen. If I navigate to another page (ui router state) and come back to the original page with the grid, it starts to work fine again. But if I refresh the browser again, the issue comes back. So, it happens only after refreshing the browser.
I tried to reproduce it in plunkr but was unsuccessful.

For now my workaround is to use ng-if instead of ng-show. Let me know if I can do anything more to help resolve this issue.
I have the same issue. With hg-if in the container that show it instead of ng-show, it fix the scroll but for me is too slow. Removing the ui-grid-selection directive, it works fine. If I resize the chrome tab it starts to scroll. I'm using the following directives on my grid: ui-grid-resize-columns, ui-grid-pagination, ui-grid-pinning, ui-grid-selection, ui-grid-edit, ui-grid-row-edit
@deepfriedbrain Did you put that exact app in plunker? And did you try it in the full browser view rather than in the iframe with the editor?
Yes I tried to use the full browser but still couldn't reproduce it in a plunker.
I created a Plunker to show this strange behavior: Here the url:
http://plnkr.co/edit/7vF92f9VR8Ck5OYDfHBd?p=preview
When you run the project, ensure that the preview is smaller than the grid so the horizontal scroll is active. When you scroll the header stay locked.
Anyway it seems to be the width in the css file. If I set a fixed size it works. If I leave 100% and set the width property "scope.gridApi.grid.gridWidth", the grid change but the header not.
In chrome I can't even scroll in your example. I have to use the arrow keys to scroll to the right/left. At that point it is very obvious that the headers aren't moving.
I tried this example in chrome and firefox and I can scroll left-right.
When the example starts, shrink the preview column quite small, press the "Show/hide" button and the grid should appear with the scroll bar in the bottom.
I've encountered the same behavior and the Plunkr that @darionato created does exhibit the behavior. Switching to using an ng-if instead of ng-show for now.
I ran into this issue, but this was primarily due to the grid being hosted in a Bootstrap tab.
The duplication is that the grid is initially hidden since it is located on a non-default tab. The root cause is that ui-grid does not know how to calculate the column alignments, due to the grid being not visible in the DOM.
Funny enough, the fix has already been documented, albeit, for a slightly different reason. The key being (and modified for ng-show / Bootstrap tabs):
$rootScope.gridOptions = {
onRegisterApi: function (gridApi) {
$scope.gridApi = gridApi;
$interval( function() {
$scope.gridApi.core.handleWindowResize();
}, 200);
}
};
Further to the above, the auto-resize module implies the same behaviour as the solution: http://plnkr.co/edit/fwdXMamTBrR1yKVwcohZ?p=preview
thank you, with this trick it works fine
Thanks the above worked for me!!!
Please read the angular docs for $interval. If you are going to execute it indefinitely, ie: with no definite number of times, you must destroy $interval, maybe when $scope is destroyed.
In addition to whats said above as solution, what worked for me was, updated all the dependencies and moved to the fresh release and set the css property of 'overflow' to 'hidden' (instead of 'visible') when using this class "ui-grid-top-panel" for grid header.
I have facing same issue in this when we click on tab(continue pressing ) button on search box on each column in grid ui on top of the header then missing alignment of the header and table data bellow image is there please help me to solve this issue

Any updates on this ??
Thanks in advance
Issue of ng-show still exists in ui-grid but @justin-lovell trick help me out. Thanks for this bro.
I am also having this issue. 100% reproducible on a grid where we set the horizontalscroll to 1 after the grid was initialized with horizontalscroll of 0.
headers become fixed and do not scroll with the data.
EDIT: nevermind. we were a version behind and updating the code base of ui-grid fixed the issue