{"action":"created","issue":{"url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/44","labels_url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/44/comments","events_url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/44/events","html_url":"https://github.com/David-Mulder/paper-datatable/issues/44","id":119635387,"number":44,"title":"Creating columns for arrays?","user":{"login":"JnJSW","id":14163527,"avatar_url":"https://avatars.githubusercontent.com/u/14163527?v=3","gravatar_id":"","url":"https://api.github.com/users/JnJSW","html_url":"https://github.com/JnJSW","followers_url":"https://api.github.com/users/JnJSW/followers","following_url":"https://api.github.com/users/JnJSW/following{/other_user}","gists_url":"https://api.github.com/users/JnJSW/gists{/gist_id}","starred_url":"https://api.github.com/users/JnJSW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JnJSW/subscriptions","organizations_url":"https://api.github.com/users/JnJSW/orgs","repos_url":"https://api.github.com/users/JnJSW/repos","events_url":"https://api.github.com/users/JnJSW/events{/privacy}","received_events_url":"https://api.github.com/users/JnJSW/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/David-Mulder/paper-datatable/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T03:37:49Z","updated_at":"2015-12-02T01:40:42Z","closed_at":null,"body":"David - thanks so much for building and sharing this element.  I've found it extremely helpful in my project.  \r\n\r\nI'm struggling with implementing one of my usecases... Was hoping you could point me in the right direction.\r\n\r\nI have a datatable mapped to an Object \"results\" which contains an array called \"legs\".  Is there an idiomatic way to create a column for each item in the legs array?  My first thought was to do a `<dom-repeat>` of `<paper-datatable-columns>` with custom `<template>`s.  However, I haven't figured out how to access the each of the items within the `<template>`.\r\n\r\nIs there a simple solution that I haven't found?  I appreciate the guidance!"},"comment":{"url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/comments/161152383","html_url":"https://github.com/David-Mulder/paper-datatable/issues/44#issuecomment-161152383","issue_url":"https://api.github.com/repos/David-Mulder/paper-datatable/issues/44","id":161152383,"user":{"login":"JnJSW","id":14163527,"avatar_url":"https://avatars.githubusercontent.com/u/14163527?v=3","gravatar_id":"","url":"https://api.github.com/users/JnJSW","html_url":"https://github.com/JnJSW","followers_url":"https://api.github.com/users/JnJSW/followers","following_url":"https://api.github.com/users/JnJSW/following{/other_user}","gists_url":"https://api.github.com/users/JnJSW/gists{/gist_id}","starred_url":"https://api.github.com/users/JnJSW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JnJSW/subscriptions","organizations_url":"https://api.github.com/users/JnJSW/orgs","repos_url":"https://api.github.com/users/JnJSW/repos","events_url":"https://api.github.com/users/JnJSW/events{/privacy}","received_events_url":"https://api.github.com/users/JnJSW/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T01:40:42Z","updated_at":"2015-12-02T01:40:42Z","body":"David - appreciate you getting back to me so quickly. I'm trying to generate the following datatable:\r\n\r\nContestant | Leg 1 Time | Leg 1 Rank | Leg 2 Time | Leg 2 Rank\r\n-------------- | -------------- | --------------- | -------------- | --------------\r\nMe  | 45 | 1 | 30 | 2\r\nYou | 50 | 2 | 20 | 1\r\n\r\nFrom the following data structure\r\n```javascript\r\n          var results = [\r\n            {\r\n              name: 'me',\r\n              legs: [\r\n                { time: 45, rank: 1},\r\n                { time: 30, rank: 2}\r\n              ]\r\n            },\r\n            {\r\n              name: 'you',\r\n              legs: [\r\n                { time: 50, rank: 2},\r\n                { time: 20, rank: 1}\r\n              ]\r\n            }\r\n```\r\n\r\nThe number of `legs` varies, so that's why I'm using an array.  I'm having a bit of trouble figuring out how to dynamically traverse that `legs` array to create a `rank` and `time` column for each.\r\n\r\nDoes that make more sense?  I appreciate your perspective when you get a shot.  Not a huge rush, this is a nights & weekends project for me.  "}}