{ "id": "62542", "key": "TIMOB-1910", "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": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2013-11-11T17:25:30.000+0000", "created": "2011-04-15T03:05:21.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [], "issuelinks": [ { "id": "33148", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "99482", "key": "TIMOB-15692", "fields": { "summary": "TiAPI: removeAllChildren method for view", "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" } }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T22:13:29.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Add the ability to clear all children from a view or a window.", "attachment": [], "flagged": false, "summary": "Add a removeAllChildren method to views and windows", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "180756", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The following is perfectly valid and demonstrates that there is no need for this method:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'black'\r\n});\r\nfor (var i=0; i < 10; i++) {\r\n\tvar x = i * 20;\r\n\tfor (var j=0; j < 20; j++) {\r\n\t\tvar y = j * 20;\r\n\t\tvar color = 'red';\r\n\t\tswitch ((x+y) % 3) {\r\n\t\t\tcase 1:\r\n\t\t\t\tcolor = 'green';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tcolor = 'blue';\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcolor = 'red';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tvar view = Ti.UI.createView({\r\n\t\t\tleft:x,\r\n\t\t\ttop:y,\r\n\t\t\twidth:20,\r\n\t\t\theight:20,\r\n\t\t\tbackgroundColor:color\r\n\t\t});\r\n\t\twin.add(view);\r\n\t}\r\n}\r\n\r\nvar b = Ti.UI.createButton({\r\n\ttitle:'Clear the view!',\r\n\twidth:200,\r\n\theight:40\r\n});\r\nwin.add(b);\r\nb.addEventListener('click', function() {\r\n\tvar viewChildren = win.children;\r\n\tTi.API.info(viewChildren);\r\n\tfor (var i=0; i < viewChildren.length; i++) {\r\n\t\tvar child = viewChildren[i];\r\n\t\twin.remove(child);\t\r\n\t}\r\n});\r\nwin.open();\r\n{code}\r\n\r\nOf course, this is a fairly extreme case... and the upcoming layout API allowing batching of operations should prevent issues like this.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-26T15:12:37.000+0000", "updated": "2012-01-26T15:12:37.000+0000" }, { "id": "180763", "author": { "name": "ziggythehamster", "key": "ziggythehamster", "displayName": "Keith Gable", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Separate issue then, but view.remove(other_view) does not always work.\r\n\r\nAlso, this would be incredibly inefficient if you had a lot of views to remove (and the platform provided a similar method to remove all child views). ", "updateAuthor": { "name": "ziggythehamster", "key": "ziggythehamster", "displayName": "Keith Gable", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-26T15:23:21.000+0000", "updated": "2012-01-26T15:23:21.000+0000" }, { "id": "180845", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Stephen's solution won't work (on Android at least), here is Q/A topic regarding this functionality: http://developer.appcelerator.com/question/131151/emptying-a-view\r\n\r\n\r\nKeith, if \"remove\" does not work, report it. :)\r\n\r\n\r\nAnd I agree that this functionality would be useful (along many other :D ). ", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-01-27T00:59:38.000+0000", "updated": "2012-01-27T00:59:38.000+0000" }, { "id": "278855", "author": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "body": "Only commenting to say at least with SDK 3.0+ there is now a removeAllChildren() method. This item appears high on a google search for this problem and it has been marked as won't fix. But actually it has been fixed.", "updateAuthor": { "name": "ndastur", "key": "ndastur", "displayName": "Neville Dastur", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-09T17:08:56.000+0000", "updated": "2013-11-09T17:08:56.000+0000" }, { "id": "278938", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving as duplicate of linked issue.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-11T17:25:30.000+0000", "updated": "2013-11-11T17:25:30.000+0000" }, { "id": "414060", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T22:13:29.000+0000", "updated": "2017-03-20T22:13:29.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }