{ "id": "122282", "key": "TIMOB-15691", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "15711", "description": "2013 Sprint 24", "name": "2013 Sprint 24", "archived": true, "released": true, "releaseDate": "2013-11-29" }, { "id": "15712", "description": "2013 Sprint 24 API", "name": "2013 Sprint 24 API", "archived": true, "released": true, "releaseDate": "2013-11-29" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-12-06T19:46:58.000+0000", "created": "2013-11-11T10:32:13.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_tableview", "qe-closed-3.3.0", "qe-testadded", "supportTeam" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:23.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": "h2. Description\r\nWe used the insertSection method to dynamically insert sections into the table on tap of a button. However, on orientation change, the labels in the rows(of the new section) either overlap with each other or don't resize accordingly, as shown in the screenshots attached.\r\n\r\nh2. Test code\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({\r\nbackgroundColor:'white'\r\n});\r\n\r\n\r\nvar myTable = Ti.UI.createTableView({\r\nbackgroundColor : \"transparent\",\r\nminRowHeight : 44,\r\nheight : '100%',\r\nwidth : '100%',\r\nstyle : Titanium.UI.iPhone.TableViewStyle.GROUPED\r\n});\r\n\r\nvar sections = [];\r\n\r\n\r\n\r\nvar tableSection = Ti.UI.createTableViewSection();\r\ntableSection.headerTitle = \"First Section\";\r\nvar aRow = Ti.UI.createTableViewRow({\r\nhighlightedColor : '#FFF',\r\ncolor : \"#2c95de\",\r\nfont : {\r\nfontSize : 17,\r\nfontWeight : \"bold\"\r\n},\r\nminimumFontSize : 12,\r\ntextAlign : 'center',\r\nheight : \"auto\",\r\ntitle : \"Tap to add New Section\"\r\n});\r\n\r\naRow.addEventListener('click',addNewSection);\r\ntableSection.add(aRow);\r\n\r\nsections.push(tableSection);\r\n\r\nvar tableSection1 = Ti.UI.createTableViewSection();\r\ntableSection1.headerTitle = \"Second Section\";\r\nfor(i = 0; i<3;i++){\r\nvar aRow = Ti.UI.createTableViewRow({\r\nbackgroundColor : \"#FFFF\",\r\nheight : 44,\r\nleft : 10,\r\nright : 10,\r\nhasChild : true,\r\nselectionStyle : Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE\r\n});\r\n\r\naRow.title = \"Row \"+i+\" Second Section\";\r\ntableSection1.add(aRow);\r\n}\r\n\r\nsections.push(tableSection1);\r\n\r\nmyTable.data = sections;\r\n\r\nwin.add(myTable);\r\nwin.open();\r\n\r\nfunction addNewSection(e)\r\n{\r\n// if(myTable.sectionCount == 2){\r\n// myTable.deleteSection(1);\r\n// }\r\n\r\nvar row1 = Ti.UI.createTableViewRow({\r\nbackgroundColor : \"#FFFF\",\r\nheight : Ti.UI.SIZE,\r\nleft : 10,\r\nright : 10,\r\nhasChild : true,\r\nselectionStyle : Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE,\r\nlayout : 'vertical'\r\n});\r\n\r\nvar row1Text = Ti.UI.createLabel({highlightedColor : '#FFF',\r\ncolor : \"#333\",\r\nfont : {\r\nfontSize : 17,\r\nfontWeight : \"bold\"\r\n},\r\nminimumFontSize : 12,\r\ntop : 2,\r\nleft : 10,\r\nright : 10,\r\nheight : 19,\r\ntext : \"Site\"\r\n});\r\n\r\nrow1.add(row1Text);\r\n\r\nvar siteTextLabel = Ti.UI.createLabel({\r\ntextAlign : \"left\",\r\ncolor : \"#6A6A6A\",\r\nleft : 10,\r\nbottom : 2,\r\nfont : {\r\nfontSize : 14\r\n},\r\nheight : Ti.UI.SIZE,\r\ntext : \"131448434,  SOME SITE NAME,  ABC CITY,  XYZ TECHNOLOGY PARK,  STATE,  MA  13148184014\"\r\n});\r\n\r\nrow1.add(siteTextLabel);\r\n\r\nvar row2 = Ti.UI.createTableViewRow({\r\nbackgroundColor : \"#FFFF\",\r\nheight : Ti.UI.SIZE,\r\nleft : 10,\r\nright : 10,\r\nhasChild : true,\r\nselectionStyle : Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE,\r\nlayout : 'vertical'\r\n});\r\n\r\nvar row2Text = Ti.UI.createLabel({highlightedColor : '#FFF',\r\ncolor : \"#333\",\r\nfont : {\r\nfontSize : 17,\r\nfontWeight : \"bold\"\r\n},\r\nminimumFontSize : 12,\r\ntop : 2,\r\nleft : 10,\r\nright : 10,\r\nheight : 19,\r\ntext : \"Product\"\r\n});\r\n\r\nrow2.add(row2Text);\r\n\r\nvar productTextLabel = Ti.UI.createLabel({\r\ntextAlign : \"left\",\r\ncolor : \"#6A6A6A\",\r\nleft : 10,\r\nbottom : 2,\r\nfont : {\r\nfontSize : 14\r\n},\r\nheight : Ti.UI.SIZE,\r\ntext : \"New Product Relaesed 12 SQL Server, Version 123, Site ABC\"\r\n});\r\n\r\nrow2.add(productTextLabel);\r\n\r\nvar tableSectionNew = Ti.UI.createTableViewSection();\r\ntableSectionNew.headerTitle = \"New Section\";\r\ntableSectionNew.add(row1);\r\ntableSectionNew.add(row2);\r\nmyTable.insertSectionAfter(0,tableSectionNew);\r\n}\r\n\r\n{code}", "attachment": [ { "id": "43789", "filename": "NotResized.png", "author": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-11T10:32:13.000+0000", "size": 408888, "mimeType": "image/png" }, { "id": "43790", "filename": "Overlapped.png", "author": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-11T10:32:13.000+0000", "size": 367899, "mimeType": "image/png" }, { "id": "43791", "filename": "ProperData.png", "author": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-11T10:32:13.000+0000", "size": 393507, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Dynamically adding sections on tableview using insertSection method does not auto re-size content on orientation change", "creator": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rsharma", "key": "rsharma", "displayName": "Rupesh Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 7 \r\niOS 6\r\nTitanium SDK 3.1.2GA, 3.1.3GA, 3.2.0.v20131117001643", "comment": { "comments": [ { "id": "280022", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4988", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-18T20:00:14.000+0000", "updated": "2013-11-18T20:00:14.000+0000" }, { "id": "302164", "author": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Verified the fix with:\r\nOSX: 10.9.2\r\nXcode: 5.1.1\r\nStudio - 3.3.0.201404211130\r\nSDK - 3.3.0.v20140422163054\r\nacs-1.0.14\r\nalloy-1.4.0-dev\r\nnpm-1.3.2\r\ntitanium-3.3.0-dev\r\ntitanium-code-processor-1.1.1-beta1\r\nDevice: iPhone 5s (7.1)", "updateAuthor": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-04-23T11:11:21.000+0000", "updated": "2014-04-23T11:11:21.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }