{"action":"created","issue":{"url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/185","labels_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/185/comments","events_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/185/events","html_url":"https://github.com/aldeed/meteor-tabular/issues/185","id":99745126,"number":185,"title":"Passing field/column to template","user":{"login":"luixal","id":615268,"avatar_url":"https://avatars.githubusercontent.com/u/615268?v=3","gravatar_id":"","url":"https://api.github.com/users/luixal","html_url":"https://github.com/luixal","followers_url":"https://api.github.com/users/luixal/followers","following_url":"https://api.github.com/users/luixal/following{/other_user}","gists_url":"https://api.github.com/users/luixal/gists{/gist_id}","starred_url":"https://api.github.com/users/luixal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luixal/subscriptions","organizations_url":"https://api.github.com/users/luixal/orgs","repos_url":"https://api.github.com/users/luixal/repos","events_url":"https://api.github.com/users/luixal/events{/privacy}","received_events_url":"https://api.github.com/users/luixal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-07T23:07:29Z","updated_at":"2015-08-09T16:33:32Z","closed_at":null,"body":"Hi, maybe this can be accomplished in another way, but I can't see how right now:\r\n\r\nLet's say I want to include a template in a cell and reuse it in other columns (in my case, a green or red label according to the true/false value of current field in two different columns). Let an screenshot explain it better:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/615268/9147550/b90451a0-3d68-11e5-924c-4a1b407f2537.png)\r\n\r\nOk, for doing this, as both columns deppend on different object fields, I need to define two templates:\r\n\r\n```html\r\n<template name=\"incidencesFieldRead\">\r\n  <span class=\"label {{#if read}}label-success{{else}}label-danger{{/if}}\"><b>{{#if isRead}}LEIDO{{else}}SIN LEER{{/if}}</b></span>\r\n</template>\r\n\r\n<template name=\"incidencesFieldSolved\">\r\n  <span class=\"label {{#if isSolved}}label-success{{else}}label-danger{{/if}}\"><b>{{#if isSolved}}SOLUCIONADO{{else}}SIN SOLUCIONAR{{/if}}</b></span>\r\n</template>\r\n```\r\nwith two different helpers:\r\n\r\n```javascript\r\nTemplate.incidencesFieldRead.helpers({\r\n  'isRead': function() {\r\n    return this.read;\r\n  }\r\n});\r\n\r\nTemplate.incidencesFieldSolved.helpers({\r\n  'isSolved': function() {\r\n    return this.solved;\r\n  }\r\n});\r\n```\r\nI'm  including this when creating the table:\r\n\r\n```javascript\r\n{\r\n  data: 'read', title: 'Leído', tmpl: Meteor.isClient && Template.incidencesFieldRead\r\n},\r\n{\r\n  data: 'solved', title: 'Solucionado', tmpl: Meteor.isClient && Template.incidencesFieldSolved\r\n}\r\n```\r\n\r\nBecause, on each template I do get the whole object, with no distinction.\r\n\r\nIs there any way of getting just the value I want (I mean, always the same variable, maybe ```data``` with the value) or at least know the column index?\r\n\r\nThanks!\r\n\r\nPS: By the way, I haven't been able to center the label inside the column, but that's another history."},"comment":{"url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/comments/129213593","html_url":"https://github.com/aldeed/meteor-tabular/issues/185#issuecomment-129213593","issue_url":"https://api.github.com/repos/aldeed/meteor-tabular/issues/185","id":129213593,"user":{"login":"Ajaxsoap","id":6571832,"avatar_url":"https://avatars.githubusercontent.com/u/6571832?v=3","gravatar_id":"","url":"https://api.github.com/users/Ajaxsoap","html_url":"https://github.com/Ajaxsoap","followers_url":"https://api.github.com/users/Ajaxsoap/followers","following_url":"https://api.github.com/users/Ajaxsoap/following{/other_user}","gists_url":"https://api.github.com/users/Ajaxsoap/gists{/gist_id}","starred_url":"https://api.github.com/users/Ajaxsoap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ajaxsoap/subscriptions","organizations_url":"https://api.github.com/users/Ajaxsoap/orgs","repos_url":"https://api.github.com/users/Ajaxsoap/repos","events_url":"https://api.github.com/users/Ajaxsoap/events{/privacy}","received_events_url":"https://api.github.com/users/Ajaxsoap/received_events","type":"User","site_admin":false},"created_at":"2015-08-09T16:33:32Z","updated_at":"2015-08-09T16:33:32Z","body":"Yup, I agree, my code is actually a quick workaround and considering I only have few of this requirements. Things can get messy if you have a lot of this requirements. "}}