{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3863","labels_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3863/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3863/comments","events_url":"https://api.github.com/repos/angular-ui/ng-grid/issues/3863/events","html_url":"https://github.com/angular-ui/ng-grid/issues/3863","id":90894035,"number":3863,"title":"Storing underlying value while displaying, filtering, and sorting by label.","user":{"login":"mgandley","id":13046176,"avatar_url":"https://avatars.githubusercontent.com/u/13046176?v=3","gravatar_id":"","url":"https://api.github.com/users/mgandley","html_url":"https://github.com/mgandley","followers_url":"https://api.github.com/users/mgandley/followers","following_url":"https://api.github.com/users/mgandley/following{/other_user}","gists_url":"https://api.github.com/users/mgandley/gists{/gist_id}","starred_url":"https://api.github.com/users/mgandley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgandley/subscriptions","organizations_url":"https://api.github.com/users/mgandley/orgs","repos_url":"https://api.github.com/users/mgandley/repos","events_url":"https://api.github.com/users/mgandley/events{/privacy}","received_events_url":"https://api.github.com/users/mgandley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-25T08:28:13Z","updated_at":"2015-06-25T08:28:13Z","closed_at":null,"body":"I can't imagine this is an uncommon request.  Say we have a dataset composed of three objects:\r\n\r\n`[task_id: 5, task_type_id: 1, task_name: \"eat bread\"]`\r\n`[task_id: 11, task_type_id: 1, task_name: \"compile code\"]`\r\n`[task_id: 15, task_type_id: 2, task_name: \"go to store\"]`\r\n\r\nNow, let's say our `task_type_id`s have an underlying definition:\r\n\r\n`[task_type_id: 1, task_type_name: \"home\"]`\r\n`[task_type_id: 2, task_type_name: \"other\"]`\r\n\r\nI want to be able to create a two column table that is formatted as such:\r\n\r\n`(col 1) - field: task_name, name: 'Task'`\r\n`(col 2) - field: task_type_id, name: 'Task Type', display: task_type_name`\r\n\r\nFor my second column, I want all filtering, sorting, and display to be based on the `task_type_name`, but I want my underlying data to be stored as `task_type_id`.  And for the display, I want to be able to point at a pre-existing array containing all my definitions and create the mapping using what is essentially a foreign key.  The functionality I envision would be similar to the `ng-options` directive in a select control:\r\n\r\n`<select class=\"form-control\" name=\"TaskType\" ng-model=\"task_type_id\" ng-options=\"tasktype .task_type_id as tasktype .task_type_name for tasktype in tasktypes\"></select>`\r\n\r\nDoes anything like this exist, or is there any way of accomplishing the above (filtering, sorting, and displaying a label value while having the model store a different one)?"}}