{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3050","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3050/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3050/comments","events_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3050/events","html_url":"https://github.com/angular-ui/ng-grid/issues/3050","id":62826294,"number":3050,"title":"AddRowHeader causes grid misalignment","user":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ng-grid/labels/Hi-Pri%20Bug","name":"Hi-Pri Bug","color":"f7c6c7"}],"state":"open","locked":false,"assignee":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/12","html_url":"https://github.com/angular-ui/ng-grid/milestones/3.0","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/milestones/12/labels","id":435248,"number":12,"title":"3.0","description":"","creator":{"login":"timothyswt","id":1736223,"avatar_url":"https://avatars.githubusercontent.com/u/1736223?v=3","gravatar_id":"","url":"https://api.github.com/users/timothyswt","html_url":"https://github.com/timothyswt","followers_url":"https://api.github.com/users/timothyswt/followers","following_url":"https://api.github.com/users/timothyswt/following{/other_user}","gists_url":"https://api.github.com/users/timothyswt/gists{/gist_id}","starred_url":"https://api.github.com/users/timothyswt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothyswt/subscriptions","organizations_url":"https://api.github.com/users/timothyswt/orgs","repos_url":"https://api.github.com/users/timothyswt/repos","events_url":"https://api.github.com/users/timothyswt/events{/privacy}","received_events_url":"https://api.github.com/users/timothyswt/received_events","type":"User","site_admin":false},"open_issues":166,"closed_issues":570,"state":"open","created_at":"2013-09-24T04:48:10Z","updated_at":"2015-03-26T05:40:20Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-03-18T23:22:30Z","updated_at":"2015-03-26T05:41:46Z","closed_at":null,"body":"When you use addRowHeader in conjunction with pinning and/or selection, you can get into situations where the grid doesn't render correctly.  It looks like the width of the left render container is being incorrectly calculated.\r\n\r\nThere are probably workarounds by calling refresh or handleWindowResize (and in my real application, expanding a grouped row does it), but the point is that we shouldn't need to.\r\n\r\nI think this may be a test case that will inform our grid refresh refactoring (if we ever do that), refer http://ui-grid.info/docs/#/api/design-rendering-cycle.\r\n\r\nI will attach a plunker when plunker decides it'd like to start saving again.  Until then the app.js and index.html are here so I can recreate later.\r\n\r\n```\r\n<!doctype html>\r\n<html ng-app=\"app\">\r\n  <head>\r\n    <script src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js\"></script>\r\n    <script src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-touch.js\"></script>\r\n    <script src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-animate.js\"></script>\r\n    <script src=\"http://ui-grid.info/docs/grunt-scripts/csv.js\"></script>\r\n    <script src=\"http://ui-grid.info/docs/grunt-scripts/pdfmake.js\"></script>\r\n    <script src=\"http://ui-grid.info/docs/grunt-scripts/vfs_fonts.js\"></script>\r\n    <script src=\"http://ui-grid.info/release/ui-grid-unstable.js\"></script>\r\n    <link rel=\"stylesheet\" href=\"http://ui-grid.info/release/ui-grid-unstable.css\" type=\"text/css\">\r\n    <link rel=\"stylesheet\" href=\"main.css\" type=\"text/css\">\r\n  </head>\r\n  <body>\r\n\r\n<div ng-controller=\"MainCtrl\">\r\n  <button ng-click=\"addRowHeader()\">AddRowHeader</button>\r\n  <div ui-grid=\"gridOptions\" class=\"grid\" ui-grid-pinning ui-grid-selection></div>\r\n</div>\r\n\r\n\r\n    <script src=\"app.js\"></script>\r\n  </body>\r\n</html>\r\n```\r\n\r\n```\r\nvar app = angular.module('app', ['ngTouch', 'ui.grid', 'ui.grid.pinning', 'ui.grid.selection']);\r\n\r\napp.controller('MainCtrl', ['$scope', '$http', '$log', '$timeout', function ($scope, $http, $log, $timeout) {\r\n  $scope.gridOptions = {\r\n    onRegisterApi: function(gridApi){ $scope.gridApi = gridApi; }\r\n  };\r\n\r\n  $scope.gridOptions.columnDefs = [\r\n    { name:'id', width:50, enablePinning:false },\r\n    { name:'name', width:100, pinnedLeft:true },\r\n    { name:'age', width:100, pinnedRight:true  },\r\n    { name:'address.street', width:150  },\r\n    { name:'address.city', width:150 },\r\n    { name:'address.state', width:50 },\r\n    { name:'address.zip', width:50 },\r\n    { name:'company', width:100 },\r\n    { name:'email', width:100 },\r\n    { name:'phone', width:200 },\r\n    { name:'about', width:300 },\r\n    { name:'friends[0].name', displayName:'1st friend', width:150 },\r\n    { name:'friends[1].name', displayName:'2nd friend', width:150 },\r\n    { name:'friends[2].name', displayName:'3rd friend', width:150 },\r\n  ];\r\n\r\n  $http.get('https://cdn.rawgit.com/angular-ui/ui-grid.info/gh-pages/data/500_complex.json')\r\n    .success(function(data) {\r\n      $scope.gridOptions.data = data;\r\n    });\r\n    \r\n  $scope.addRowHeader = function() {\r\n    if( !$scope.rowAdded ){\r\n      $scope.gridApi.core.addRowHeaderColumn( { name: 'test' } );\r\n      $timeout(function() {\r\n        $scope.gridApi.core.refresh();\r\n        $timeout(function() {\r\n          $scope.gridApi.core.refresh();\r\n        });\r\n      });\r\n      $scope.rowAdded = true;\r\n    } \r\n  }\r\n}]);\r\n```"},"comment":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/comments/86351237","html_url":"https://github.com/angular-ui/ng-grid/issues/3050#issuecomment-86351237","issue_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3050","id":86351237,"user":{"login":"PaulL1","id":5248789,"avatar_url":"https://avatars.githubusercontent.com/u/5248789?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulL1","html_url":"https://github.com/PaulL1","followers_url":"https://api.github.com/users/PaulL1/followers","following_url":"https://api.github.com/users/PaulL1/following{/other_user}","gists_url":"https://api.github.com/users/PaulL1/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulL1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulL1/subscriptions","organizations_url":"https://api.github.com/users/PaulL1/orgs","repos_url":"https://api.github.com/users/PaulL1/repos","events_url":"https://api.github.com/users/PaulL1/events{/privacy}","received_events_url":"https://api.github.com/users/PaulL1/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T05:41:46Z","updated_at":"2015-03-26T05:41:46Z","body":"Moved this into the plunker: http://plnkr.co/edit/leP2x2FanozxMOD7grhF?p=preview"}}