{ "id": "117429", "key": "TIMOB-14795", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-15T05:03:31.000+0000", "created": "2013-07-21T18:42:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parent", "view" ], "versions": [], "issuelinks": [ { "id": "31030", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "84108", "key": "TIDOC-199", "fields": { "summary": "APIDoc: 'parent' property absent from Ti.UI.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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "52603", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "120591", "key": "TIMOB-15367", "fields": { "summary": "getParent() doesn't listed in the docs", "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": "Low", "id": "4" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-11-15T05:03:39.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "Only via Q&A I discovered I can use {{.parent}} and {{.getParent()}} to get the parent of any view. This is extremely useful in many cases.\r\n\r\nIs there are reason for not documenting these? Is it not stable or going to be deprecated soon for another reason?\r\n\r\nIf not, please document it :)", "attachment": [], "flagged": false, "summary": "TiAPI: Add \"parent\" property for all Ti.UI.View subclasses", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "comment": { "comments": [ { "id": "265614", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Talked with development. This property is not meant to be exposed as a public API. Tested on iOS and Android and the behavior is different.", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-08T19:42:48.000+0000", "updated": "2013-08-08T19:42:48.000+0000" }, { "id": "265698", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "So, why not make it behave the same? Being able to get the parent of an element can be quite useful? Should I open another ticket to request the feature to be made solid and public?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-08-09T06:49:09.000+0000", "updated": "2013-08-09T06:49:09.000+0000" }, { "id": "265716", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi [~fokke],\n\nI moved the ticket over to TIMOB as a new feature request.\n\nCould you please provide an explanation of why you want this feature and the expected behavior for the development team?\n\nThanks.", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-09T16:20:13.000+0000", "updated": "2013-08-09T16:20:13.000+0000" }, { "id": "266405", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "The expected behavior is for {{view.parent}} and {{view.getParent()}} to return the parent view.\r\n\r\n{code}\r\nvar viewOne = Ti.UI.createView();\r\nvar viewTwo = Ti.UI.createView();\r\n\r\nviewOne.add(viewTwo);\r\n\r\nassert(viewOne.parent === viewTwo);\r\n{code}\r\n\r\nAn example use case is removing a view in an Alloy controller. Without {{.parent}} I need to assign an {{id}} to the parent view. With, I can just do {{$.myView.parent.remove($.myView);}}\r\n\r\nWhich makes me think another method that might make sense would be: {{removeFromParent()}}, basically doing the above? \r\n", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-08-14T11:46:35.000+0000", "updated": "2017-03-29T13:58:12.000+0000" }, { "id": "394823", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "We should add this. It makes tons of sense. Mobile Web had this.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-30T19:37:41.000+0000", "updated": "2016-08-30T19:37:41.000+0000" }, { "id": "410284", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "+1 this is basic functionality", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-03-09T15:45:00.000+0000", "updated": "2017-03-09T15:45:00.000+0000" }, { "id": "416132", "author": { "name": "icecandy", "key": "icecandy", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "body": "+1 This should be a fundamental option. Like a lot of other things in Ti, basic UI often seems neglected.\r\nAs Fokke comments it can be useful, because otherwise one has to always pass references to the parent view into the controller in question.", "updateAuthor": { "name": "icecandy", "key": "icecandy", "displayName": "Simon Buckingham", "active": true, "timeZone": "Europe/London" }, "created": "2017-03-29T13:53:21.000+0000", "updated": "2017-03-29T13:53:21.000+0000" }, { "id": "424783", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We will do it. And if there are parity-gaps, we should discuss them in this ticket. I tested it with iOS and it works just as expected, going directly from the managed view-proxy. I am wondering how Android could behave different here (maybe [~gmathews] has some input here). Also, does Windows support this, [~kiguchi]? Making this for 7.0.0 should be doable, let me know your thoughts! :-)\r\n\r\n*EDIT*: Tested with Android and it works just fine as well. Let's do this!\r\n\r\n*EDIT 2*: [This branch|https://github.com/appcelerator/titanium_mobile/compare/master...hansemannn:TIMOB-14795?expand=1] is waiting to be PR'd once we have a decision.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-26T14:13:58.000+0000", "updated": "2017-07-26T14:19:15.000+0000" }, { "id": "424784", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Yes!", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-07-26T14:21:24.000+0000", "updated": "2017-07-26T14:21:24.000+0000" }, { "id": "424790", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel] {{View.parent}} property and {{get/setParent}} functions are already supported on Windows. We also have unit tests: [ti.ui.view.test.js#L452|https://github.com/appcelerator/titanium_mobile_windows/blob/master/Examples/NMocha/src/Assets/ti.ui.view.test.js#L452]", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-26T14:52:12.000+0000", "updated": "2017-07-26T14:52:12.000+0000" }, { "id": "424791", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Great! Than we should add more unit-tests to the PR and merge it in I guess.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-26T14:57:27.000+0000", "updated": "2017-07-26T14:57:27.000+0000" }, { "id": "429612", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Assigning to Gary to clarify how Android handles this. As iOS and Windows do handle it already, we may close this if Android passes as well.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-25T22:00:37.000+0000", "updated": "2017-10-25T22:00:37.000+0000" }, { "id": "429740", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Android also has this implemented, here's a quick test case. The one above is incorrect:\r\n\r\n{code:js}\r\nvar a = Ti.UI.createView(),\r\n b = Ti.UI.createView();\r\n\r\na.add(b);\r\n\r\nalert(b.parent === a); // true\r\n{code}\r\n\r\nWe only need to add {{parent}} to our docs", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-27T16:15:34.000+0000", "updated": "2017-10-27T16:17:39.000+0000" }, { "id": "430651", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I verified the test case on Android; per comments, I'll close the ticket.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T05:02:59.000+0000", "updated": "2017-11-15T05:02:59.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }