{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4441","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4441/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4441/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4441/events","html_url":"https://github.com/angular-ui/ui-grid/issues/4441","id":108681060,"number":4441,"title":"Custom sorting passing objects instead of cell value?","user":{"login":"robgrimball","id":8190747,"avatar_url":"https://avatars.githubusercontent.com/u/8190747?v=3","gravatar_id":"","url":"https://api.github.com/users/robgrimball","html_url":"https://github.com/robgrimball","followers_url":"https://api.github.com/users/robgrimball/followers","following_url":"https://api.github.com/users/robgrimball/following{/other_user}","gists_url":"https://api.github.com/users/robgrimball/gists{/gist_id}","starred_url":"https://api.github.com/users/robgrimball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robgrimball/subscriptions","organizations_url":"https://api.github.com/users/robgrimball/orgs","repos_url":"https://api.github.com/users/robgrimball/repos","events_url":"https://api.github.com/users/robgrimball/events{/privacy}","received_events_url":"https://api.github.com/users/robgrimball/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-28T15:22:03Z","updated_at":"2015-10-07T18:33:22Z","closed_at":"2015-10-07T18:33:22Z","body":"It would be really nice if custom sorting inside UI-Grid would pass the objects associated with the rows rather than just the cell value, or if there was a custom sort option allowing for that.\r\n\r\nFor instance, right now : \r\n\r\nsortingAlgorithm: function(aVal, bVal) { }\r\n\r\naVal and bVal are values which sometimes is exactly what you want when sorting.\r\n\r\nBut proposing something like : \r\n\r\nsortingAlgorithmByObj: function(aObj, bObj) { }\r\n\r\nWhere aObj and bObj would present the actual objects in the datagrid.  This way you could reference other aspects of the objects that you might want to have affect the sorting.  For instance, I would like to have whether or not the object is selected or not put it at the top of the sort.  This would be easily done if I had access to the objects which would in turn give me access to whether the object was selected as well as it's value for that column to sort on secondarily.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/comments/146287070","html_url":"https://github.com/angular-ui/ui-grid/issues/4441#issuecomment-146287070","issue_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4441","id":146287070,"user":{"login":"robgrimball","id":8190747,"avatar_url":"https://avatars.githubusercontent.com/u/8190747?v=3","gravatar_id":"","url":"https://api.github.com/users/robgrimball","html_url":"https://github.com/robgrimball","followers_url":"https://api.github.com/users/robgrimball/followers","following_url":"https://api.github.com/users/robgrimball/following{/other_user}","gists_url":"https://api.github.com/users/robgrimball/gists{/gist_id}","starred_url":"https://api.github.com/users/robgrimball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robgrimball/subscriptions","organizations_url":"https://api.github.com/users/robgrimball/orgs","repos_url":"https://api.github.com/users/robgrimball/repos","events_url":"https://api.github.com/users/robgrimball/events{/privacy}","received_events_url":"https://api.github.com/users/robgrimball/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T18:33:22Z","updated_at":"2015-10-07T18:33:22Z","body":"Works like a charm, closing this now, thanks!"}}