{"action":"created","issue":{"url":"https://api.github.com/repos/quasarframework/quasar/issues/821","repository_url":"https://api.github.com/repos/quasarframework/quasar","labels_url":"https://api.github.com/repos/quasarframework/quasar/issues/821/labels{/name}","comments_url":"https://api.github.com/repos/quasarframework/quasar/issues/821/comments","events_url":"https://api.github.com/repos/quasarframework/quasar/issues/821/events","html_url":"https://github.com/quasarframework/quasar/issues/821","id":252026178,"node_id":"MDU6SXNzdWUyNTIwMjYxNzg=","number":821,"title":"[Request] Allow data table 'field' to come from deeper than top level of data object.","user":{"login":"kastork","id":202288,"node_id":"MDQ6VXNlcjIwMjI4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/202288?v=4","gravatar_id":"","url":"https://api.github.com/users/kastork","html_url":"https://github.com/kastork","followers_url":"https://api.github.com/users/kastork/followers","following_url":"https://api.github.com/users/kastork/following{/other_user}","gists_url":"https://api.github.com/users/kastork/gists{/gist_id}","starred_url":"https://api.github.com/users/kastork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kastork/subscriptions","organizations_url":"https://api.github.com/users/kastork/orgs","repos_url":"https://api.github.com/users/kastork/repos","events_url":"https://api.github.com/users/kastork/events{/privacy}","received_events_url":"https://api.github.com/users/kastork/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/quasarframework/quasar/milestones/9","html_url":"https://github.com/quasarframework/quasar/milestone/9","labels_url":"https://api.github.com/repos/quasarframework/quasar/milestones/9/labels","id":2203083,"node_id":"MDk6TWlsZXN0b25lMjIwMzA4Mw==","number":9,"title":"v0.15","description":"","creator":{"login":"rstoenescu","id":4665641,"node_id":"MDQ6VXNlcjQ2NjU2NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/4665641?v=4","gravatar_id":"","url":"https://api.github.com/users/rstoenescu","html_url":"https://github.com/rstoenescu","followers_url":"https://api.github.com/users/rstoenescu/followers","following_url":"https://api.github.com/users/rstoenescu/following{/other_user}","gists_url":"https://api.github.com/users/rstoenescu/gists{/gist_id}","starred_url":"https://api.github.com/users/rstoenescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstoenescu/subscriptions","organizations_url":"https://api.github.com/users/rstoenescu/orgs","repos_url":"https://api.github.com/users/rstoenescu/repos","events_url":"https://api.github.com/users/rstoenescu/events{/privacy}","received_events_url":"https://api.github.com/users/rstoenescu/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":181,"state":"closed","created_at":"2016-12-18T16:39:57Z","updated_at":"2018-03-03T03:46:10Z","due_on":null,"closed_at":"2018-02-21T00:30:31Z"},"comments":6,"created_at":"2017-08-22T17:05:18Z","updated_at":"2018-09-27T05:47:15Z","closed_at":"2017-10-20T17:33:31Z","author_association":"NONE","body":"Sometimes data coming from the server that you want to display as a data table is not flat.\r\n\r\n```\r\ndata () {\r\n return {\r\n   tableData: [\r\n     { \r\n         id: 1,\r\n         name: 'fred',\r\n         boss: {\r\n            id: 2,\r\n            name: 'bossman'\r\n         }\r\n      },\r\n ...\r\n]\r\n```\r\n\r\nNow, in a column configuration, there's no way to identify boss.name as the data for a column. i.e., something like,\r\n\r\n```\r\nid   name   bossName\r\n--  -----   --------\r\n1   fred     bossman\r\n```   \r\n\r\nThe work-arounds I can think of:\r\n\r\n1. Change the shape of what comes from the server (you might not have control of the server, so this one isn't always available).\r\n\r\n2. Flatten the data by using a computed property to transform the hierarchical structure to a flat one.  This isn't so bad, but is probably not a great idea when the data set starts getting large.\r\n\r\n```\r\nimport _ from 'lodash\r\n\r\ntableData: function () {\r\n     return _.map(this.employees, (employee) => {\r\n       return {id: employee.id, name: employee.name, bossName: employee.boss.name}\r\n     })\r\n  }\r\n```\r\n\r\nThis seems to work at first blush, but I'm not certain it would hold up in all the data table use-cases like changing the sort or applying filters.\r\n\r\nPerhaps it could look like,\r\n\r\n```\r\ncolumns: [\r\n   {\r\n      label: 'bossName',\r\n      field: 'boss.name',\r\n...\r\n```\r\n\r\nI'd also be satisfied with a workaround that didn't involve duplication of the entire data source array.  Perhaps one exists using a function in place of the field name, but I can't think of it.\r\n"},"comment":{"url":"https://api.github.com/repos/quasarframework/quasar/issues/comments/424966404","html_url":"https://github.com/quasarframework/quasar/issues/821#issuecomment-424966404","issue_url":"https://api.github.com/repos/quasarframework/quasar/issues/821","id":424966404,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDk2NjQwNA==","user":{"login":"smolinari","id":3314957,"node_id":"MDQ6VXNlcjMzMTQ5NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/3314957?v=4","gravatar_id":"","url":"https://api.github.com/users/smolinari","html_url":"https://github.com/smolinari","followers_url":"https://api.github.com/users/smolinari/followers","following_url":"https://api.github.com/users/smolinari/following{/other_user}","gists_url":"https://api.github.com/users/smolinari/gists{/gist_id}","starred_url":"https://api.github.com/users/smolinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smolinari/subscriptions","organizations_url":"https://api.github.com/users/smolinari/orgs","repos_url":"https://api.github.com/users/smolinari/repos","events_url":"https://api.github.com/users/smolinari/events{/privacy}","received_events_url":"https://api.github.com/users/smolinari/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T05:47:15Z","updated_at":"2018-09-27T05:47:15Z","author_association":"CONTRIBUTOR","body":"@stefanvanherwijnen - Correct! I was testing to see if anyone was awake! You passed! LOL! :)\r\n\r\nJust kidding. \r\n\r\nHere is a fiddle to show it correctly. \r\n\r\nhttps://jsfiddle.net/smolinari/g7vj091a/\r\n\r\nScott"}}
{"actor":{"display_login":"smolinari"}}