{ "id": "101848", "key": "TIMOB-11083", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2012-09-24T15:55:39.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:07.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6.Feature request\r\nBind Events in Control Creation & Enable Code Chaining\r\n\r\nh6.Customer's remarks\r\nI would like the ability to bind events to controls in the property list during creation. This would clean up my code by freeing me from creating a variable for every control, when the only purpose for the variable is assigning an event. \r\n\r\nSecondly, when a method is called on an object, the return of the method should be the control so you can chain your code.\r\n\r\nh6.Sample\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar lbl =Ti.UI.createLabel({\r\n text: 'test'\r\n});\r\n\r\nlbl.addEventListener('click', function({ alert(this.text); });\r\n\r\nwin.add(lbl);\r\n\r\nwin.open()\r\n{code}\r\n\r\nh6.Could become\r\n{code}\r\nTi.UI.createWindow().add(Ti.UI.createLabel({\r\n text: 'test',\r\n eventClick: function(){ alert(this.text); } \r\n}).open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Feature: Bind Events in Control Creation & Enable Code Chaining", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "342834", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This can easily be done using plain JavaScript. Take a look at this solution and see if it's something you can work with. Feel free to modify it and customize it for your own use.\r\n\r\nhttps://gist.github.com/pec1985/3758713", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-02-10T21:06:08.000+0000", "updated": "2015-02-10T21:06:08.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }