{ "id": "123704", "key": "ALOY-899", "fields": { "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-12-13T15:16:36.000+0000", "created": "2013-12-13T14:53:41.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "33762", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "123713", "key": "TIMOB-15986", "fields": { "summary": "Allow applyProperties on ListViewItem", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-22T13:23:16.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": [], "description": "h2. Description\r\nWhile it is possible to change the style of a ListViewItem by changing the properties one by one (e.g. backgroundColor), it is not possible to use `addClass`, `removeClass` or `resetClass` to change them by using the classes.\r\n\r\nh2. Test code\r\n\r\nindex.xml\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\napp.tss\r\n{code}\r\n\".firststyle\" : {\r\n backgroundColor:\"green\"\r\n},\r\n\".secondstyle\" : {\r\n backgroundColor:\"yellow\" \r\n}\r\n{code}\r\n\r\nindex.js\r\n{code}\r\n$.index.open();\r\n\r\nvar data = [{\r\n\tmyview : {\r\n\t\ttext: \"One\"\r\n\t}\r\n}, {\r\n\tmyview : {\r\n\t\ttext : \"Two\"\r\n\t}\r\n}];\r\n\r\n$.section.setItems(data);\r\n\r\n$.list.addEventListener('itemclick', function(e) {\r\n\tvar item = e.section.getItemAt(e.itemIndex);\r\n\t// item.myview.backgroundColor = \"red\";\r\n\t$.resetClass(item.myview, \"secondclass\");\r\n\te.section.updateItemAt(e.itemIndex, item);\r\n});\r\n{code}\r\n\r\nh2. Note\r\n\r\nIn the code above, note how changing the color works instead.", "attachment": [], "flagged": false, "summary": "Cannot add/remove class from ListViewItem", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "284207", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As I suspected, Ti.UI.ListItem does not support the {{applyProperties()}} function, which is critical to the dynamic style application process. I am marking this as \"won't fix\" as this won't be fixed in Alloy. I do suggest however that this issue be moved to TIMOB and better named to more precisely identify what the problem is here, as a fix in TIMOB for supporting {{applyProperties}} on ListItems would make this code work automatically in Alloy.\r\n\r\nAlso, you didn't mention the actual error that occurs which identifies the missing {{applyProperties}} function as the culprit, so please add that before moving it to TIMOB.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-13T15:16:36.000+0000", "updated": "2013-12-13T15:17:28.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }