{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/5279","repository_url":"https://api.github.com/repos/angular-ui/ui-grid","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/5279/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/5279/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/5279/events","html_url":"https://github.com/angular-ui/ui-grid/issues/5279","id":145678331,"number":5279,"title":"Sort function is guessed as sortAlpha and cached when sort applied to empty grid","user":{"login":"rwilliams-scottlogic","id":8235966,"avatar_url":"https://avatars.githubusercontent.com/u/8235966?v=3","gravatar_id":"","url":"https://api.github.com/users/rwilliams-scottlogic","html_url":"https://github.com/rwilliams-scottlogic","followers_url":"https://api.github.com/users/rwilliams-scottlogic/followers","following_url":"https://api.github.com/users/rwilliams-scottlogic/following{/other_user}","gists_url":"https://api.github.com/users/rwilliams-scottlogic/gists{/gist_id}","starred_url":"https://api.github.com/users/rwilliams-scottlogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwilliams-scottlogic/subscriptions","organizations_url":"https://api.github.com/users/rwilliams-scottlogic/orgs","repos_url":"https://api.github.com/users/rwilliams-scottlogic/repos","events_url":"https://api.github.com/users/rwilliams-scottlogic/events{/privacy}","received_events_url":"https://api.github.com/users/rwilliams-scottlogic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-04T13:04:05Z","updated_at":"2016-04-04T13:04:05Z","closed_at":null,"body":"When there is no data in the grid and the user clicks to sort a column, the row sort function will be cached based on the guess (sortAlpha). Say this is a numeric column and you later add data, it will always sort as alpha because the guess was cached.\r\n\r\nWorkaround (and probably best practice): specify explicitly rather than rely on guess. But it's possible to accidentally rely on guess.\r\n\r\n- [x] This is a bug report, not a question on how to use the grid.  \r\nUse [Stack Overflow](http://stackoverflow.com/questions/tagged/angular-ui-grid) or [Gitter](https://gitter.im/angular-ui/ui-grid) for questions.\r\n- [x] You have searched the open issues to see if this bug has been filed before.  We don't want duplicate issues.\r\n- [x] You have reviewed the tutorials and documentation to ensure you are using the grid correctly. [ui-grid.info](http://ui-grid.info/docs/#/tutorial)\r\n- [x] You are using the latest version of the grid. Older versions are not patched or supported.\r\n- [x] You have provided steps to recreate your bug.  A plunkr is even better.\r\n"}}