{ "id": "115400", "key": "ALOY-684", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "99986", "key": "ALOY-210", "fields": { "summary": "Support Dynamic Styling", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15402", "description": "Alloy 1.2.0, concurrent with SDK 3.1.0", "name": "Alloy 1.2.0", "archived": false, "released": true, "releaseDate": "2013-08-15" }, { "id": "15489", "description": "2013 Sprint 12", "name": "2013 Sprint 12", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-07T21:08:55.000+0000", "created": "2013-06-03T21:06:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "notable", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "29247", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "115401", "key": "ALOY-685", "fields": { "summary": "Port generateStyleParams() into a runtime version", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "29533", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "112534", "key": "ALOY-613", "fields": { "summary": "Develop API for adding/removing style classes", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": null, "updated": "2018-03-07T22:26:16.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" }, { "id": "13603", "name": "Styling", "description": "TSS, dynamic styling, styling API" } ], "description": "{code:javascript}\r\nvar ctr = 0;\r\nvar classes = [\r\n\t[],\r\n\t['big'],\r\n\t['blue'],\r\n\t'shadow',\r\n\t['shadow'],\r\n\t['shadow', 'big'],\r\n\t['big', 'shadow'],\r\n\t['big', 'blue', 'shadow'],\r\n\t'big blue shadow'\r\n]\r\n\r\nfunction addNewLabel(e) {\r\n\tvar index = ctr % classes.length;\r\n\r\n\t// Alloy.createView() for creating new titanium view proxies with a \r\n\t// given set of style attributes to determine which styles should be\r\n\t// applied.\r\n\tvar label = Alloy.UI.create(\r\n\t\t// the name of the controller from which to reference styles\r\n\t\t'index',\r\n\r\n\t\t// The Titanium API to use for the creation. In this case we use \"Label\"\r\n\t\t// but the full \"Ti.UI.Label\" would work as well. Like in the XML,\r\n\t\t// implicit namespaces and defaults will be checked if an explicit\r\n\t\t// namespace is not given.\r\n\t\t'Label', \r\n\t\t\r\n\t\t// The 2nd parameter is an object that holds style information, like id\r\n\t\t// and classes, as well as the typical parameters you would pass to a\r\n\t\t// Titanium proxy. This allows the creation and property application to\r\n\t\t// be done in a single command, making for the best runtime performance. \r\n\t\t{\r\n\t\t\t// style attributes\r\n\t\t\tclasses: classes[index],\r\n\t\t\tid: 'newLabel' + (ctr+1),\r\n\r\n\t\t\t// basic proxy properties that apply to Label\r\n\t\t\ttext: 'this is label #' + (ctr+1),\r\n\t\t\ttouchEnabled: false\r\n\t\t}\r\n\t);\r\n\r\n\t$.index.add(label);\r\n\tctr++;\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\nInternally, Alloy.createView() would use the runtime version of generateStyleParams to apply the appropriate styles based on the given options.", "attachment": [], "flagged": false, "summary": "Interface for dynamically creating styled UI elements", "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": "256732", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/alloy/pull/149\r\ntest app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-684\r\n\r\nFunctionally testing should involve successfully running the app on all supported platforms. While running, repeatedly click the main window. The result should be that a dynamically styled label should appear on the screen after each click. The style of the label should be impacted by the current array of styles applied to it, found in the *classes* array variable in the *app/controllers/index.js* controller.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-07T21:08:55.000+0000", "updated": "2013-06-07T21:08:55.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }