{ "id": "108640", "key": "ALOY-489", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15271", "description": "Alloy 1.1.0, concurrent with SDK 3.1.0", "name": "Alloy 1.1.0", "archived": false, "released": true, "releaseDate": "2013-04-16" }, { "id": "14873", "description": "2013 Sprint 04", "name": "2013 Sprint 04", "archived": true, "released": true, "releaseDate": "2013-02-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-12T21:10:38.000+0000", "created": "2013-01-28T18:41:07.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-testadded" ], "versions": [ { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-12T21:10:38.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "Alloy currently uses an under-the-hood unique variable name for any binding functions used for collection binding. For example, here's some markup and its generated binding code:\r\n\r\n{code:xml}\r\n\r\n\t\r\n\r\n{code}\r\n\r\n{code:javascript}\r\nvar __alloyId19 = function(e) {\r\n var models = Alloy.Collections.myModel.models, len = models.length, rows = [];\r\n for (var i = 0; i < len; i++) {\r\n var __alloyId17 = models[i];\r\n __alloyId17.__transform = {};\r\n var __alloyId18 = Alloy.createController(\"row\", {\r\n id: \"__alloyId15\",\r\n $model: __alloyId17\r\n });\r\n rows.push(__alloyId18.getViewEx({\r\n recurse: !0\r\n }));\r\n }\r\n $.__views.table.setData(rows);\r\n};\r\n{code}\r\n\r\nIt would be beneficial to developers to have direct access to that function so that they can trigger the binding themselves. This would be useful in cases where perhaps local filtering was being performed on a collection but the developer didn't actually want to modify or fetch the collection, they just want the UI to reflect the filtering. It would look like this:\r\n\r\n{code:xml}\r\n\r\n\t\r\n\r\n{code}\r\n\r\nand then a developer could directly call this function in their own controller when they wanted to execute the binding code:\r\n\r\n{code:javascript}\r\nmyBindingFunction();\r\n{code}", "attachment": [], "flagged": false, "summary": "Allow developers to specify an explicit function name for autogen binding function", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "238545", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "dataFunction attribute let's you specify an explicit function for data binding that can be called in the controller as specified above. THe test app for it can be found here: https://github.com/appcelerator/alloy/tree/master/test/apps/models/binding_dataFunction", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T15:37:42.000+0000", "updated": "2013-02-14T15:37:42.000+0000" }, { "id": "261681", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening for changing labels", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-12T21:10:16.000+0000", "updated": "2013-07-12T21:10:16.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }