{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4869","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4869/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4869/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4869/events","html_url":"https://github.com/angular-ui/ui-grid/issues/4869","id":122541592,"number":4869,"title":"CellTemplate directive disassociated with row data","user":{"login":"jklaus","id":2191731,"avatar_url":"https://avatars.githubusercontent.com/u/2191731?v=3","gravatar_id":"","url":"https://api.github.com/users/jklaus","html_url":"https://github.com/jklaus","followers_url":"https://api.github.com/users/jklaus/followers","following_url":"https://api.github.com/users/jklaus/following{/other_user}","gists_url":"https://api.github.com/users/jklaus/gists{/gist_id}","starred_url":"https://api.github.com/users/jklaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklaus/subscriptions","organizations_url":"https://api.github.com/users/jklaus/orgs","repos_url":"https://api.github.com/users/jklaus/repos","events_url":"https://api.github.com/users/jklaus/events{/privacy}","received_events_url":"https://api.github.com/users/jklaus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-16T16:13:09Z","updated_at":"2015-12-17T15:12:25Z","closed_at":null,"body":"I'm trying to understand the cause of what seems to be a known issue the use of directives in cellTemplate.\r\n\r\nI have logic which examines a nested array, if any of these array objects have a status of 'prohibited' I am rendering 'prohibited' in that grid cell.  When I execute this logic within a $filter it works fine but if I put this logic in the link (or controller) of my directive it only works proper for the first ~20 rows.  Once you begin scrolling, or sort the grid, the column rendering the directive becomes disassociated with the rest of the data.  I have executed a similar test as proposed <a href='http://stackoverflow.com/questions/30230268/custom-directive-in-cell-template-in-ui-grid-angularjs'>here</a> and have found that $scope.row.entity is indeed disassociated with the actual row being rendered.  \r\n\r\nWhile I can work around this issue via the $filter approach it feels dirty since I'll also be wrapping the 'prohibited' string in dom elements to add styling.\r\n\r\nIf need be I can create a plunkr to demonstrate what I'm seeing.. but at this point I am certain the issue arises when the filtering logic is executed inside the directive.  Even calling the actual $filter inside the directive causes this issue.  Yet I can call the $filter via cellFilter or directly in the markup of the cellTemplate (cellTemplate:'\\<div>{{MODEL_COL_FIELD | MyFilterHere}}\\</div>') without issue."},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/comments/165479663","html_url":"https://github.com/angular-ui/ui-grid/issues/4869#issuecomment-165479663","issue_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4869","id":165479663,"user":{"login":"jklaus","id":2191731,"avatar_url":"https://avatars.githubusercontent.com/u/2191731?v=3","gravatar_id":"","url":"https://api.github.com/users/jklaus","html_url":"https://github.com/jklaus","followers_url":"https://api.github.com/users/jklaus/followers","following_url":"https://api.github.com/users/jklaus/following{/other_user}","gists_url":"https://api.github.com/users/jklaus/gists{/gist_id}","starred_url":"https://api.github.com/users/jklaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklaus/subscriptions","organizations_url":"https://api.github.com/users/jklaus/orgs","repos_url":"https://api.github.com/users/jklaus/repos","events_url":"https://api.github.com/users/jklaus/events{/privacy}","received_events_url":"https://api.github.com/users/jklaus/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T15:12:25Z","updated_at":"2015-12-17T15:12:25Z","body":"@PaulL1  \r\nI ended up posting my issue on <a href=\"http://stackoverflow.com/questions/34321797/directive-rendered-via-ui-grid-celltemplate-rendering-incorrectly\">stack overflow</a> and someone suggested wrapping all of the logic within a watch.  While this does solve the issue I don't quite understand why.  The directive is still being fired regardless, it just seems as though its running on stale/disassociated data outside of the watch.  Perhaps I have a flawed view of how the link function should be operating?"}}