{"action":"created","issue":{"url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/574","repository_url":"https://api.github.com/repos/kevinchappell/formBuilder","labels_url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/574/comments","events_url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/574/events","html_url":"https://github.com/kevinchappell/formBuilder/issues/574","id":248256221,"number":574,"title":"Attributes values of custom templates ","user":{"login":"dema121","id":2117064,"avatar_url":"https://avatars3.githubusercontent.com/u/2117064?v=4","gravatar_id":"","url":"https://api.github.com/users/dema121","html_url":"https://github.com/dema121","followers_url":"https://api.github.com/users/dema121/followers","following_url":"https://api.github.com/users/dema121/following{/other_user}","gists_url":"https://api.github.com/users/dema121/gists{/gist_id}","starred_url":"https://api.github.com/users/dema121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dema121/subscriptions","organizations_url":"https://api.github.com/users/dema121/orgs","repos_url":"https://api.github.com/users/dema121/repos","events_url":"https://api.github.com/users/dema121/events{/privacy}","received_events_url":"https://api.github.com/users/dema121/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-06T16:12:18Z","updated_at":"2017-08-07T08:36:38Z","closed_at":null,"body":"### Description:\r\nWith version 2.1.2 I declared a custom field/template like this:\r\n```\r\nfields: {\r\n    label: 'My custom label',\r\n    attrs: {\r\n        type: 'mytype',\r\n        required: true\r\n    },\r\n    icon: 'P'\r\n},\r\ntemplates: {\r\n   mytype: function (fieldData) {\r\n        return {\r\n            field: '<span ...>...',\r\n            onRender: function () {\r\n                ...\r\n            }\r\n        };\r\n    },\r\n}\r\n```\r\nWith this method I was able to set field attributes like required, description, className, etc.\r\n\r\nNow I update to version 2.5.3 and so edited a bit my configurations:\r\n```\r\nfields: {\r\n    label: 'My custom label',\r\n    type: 'mytype',\r\n    required: true,\r\n    icon: 'P'\r\n},\r\ntemplates: {\r\n   mytype: function (fieldData) {\r\n        return {\r\n            field: '<span ...>...',\r\n            onRender: function () {\r\n                ...\r\n            }\r\n        };\r\n    },\r\n}\r\n```\r\nBut now I'm not able to set attributes (like required, description, etc.) of custom templates.\r\nWhat am I missing?\r\n### Environment Details:\r\n\r\n - formBuilder Version: 2.53\r\n - Browser: Chrome\r\n - OS: Ubuntu 17.04\r\n\r\n### Expected Behavior\r\nSetting attributes values of custom templates. \r\n\r\n### Actual Behavior\r\nAttributes values of custom templates aren't set."},"comment":{"url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/comments/320603975","html_url":"https://github.com/kevinchappell/formBuilder/issues/574#issuecomment-320603975","issue_url":"https://api.github.com/repos/kevinchappell/formBuilder/issues/574","id":320603975,"user":{"login":"dema121","id":2117064,"avatar_url":"https://avatars3.githubusercontent.com/u/2117064?v=4","gravatar_id":"","url":"https://api.github.com/users/dema121","html_url":"https://github.com/dema121","followers_url":"https://api.github.com/users/dema121/followers","following_url":"https://api.github.com/users/dema121/following{/other_user}","gists_url":"https://api.github.com/users/dema121/gists{/gist_id}","starred_url":"https://api.github.com/users/dema121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dema121/subscriptions","organizations_url":"https://api.github.com/users/dema121/orgs","repos_url":"https://api.github.com/users/dema121/repos","events_url":"https://api.github.com/users/dema121/events{/privacy}","received_events_url":"https://api.github.com/users/dema121/received_events","type":"User","site_admin":false},"created_at":"2017-08-07T08:36:38Z","updated_at":"2017-08-07T08:36:38Z","body":"Sorry, my fault in writing the example. `fields` is an array with that object.\r\nhttps://codepen.io/anon/pen/KvaraW\r\nHere you can see the issue. I forked your starRating example in the templates documentation and adapted to include required and description attributes.\r\nThe email 'alias' (using existing types and subtypes) works great, and also required and description attributes are inserted correctly.\r\nHowever `starRating` field hasn't all the desidered attributes."}}
{"actor":{"display_login":"dema121"}}