{ "id": "126413", "key": "TIMOB-16482", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-02-14T02:14:10.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ios" ], "versions": [ { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:11.000+0000", "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" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When using tableview.updateSection, row layout:'horizontal' and layout:'vertical' does not work. Layout: 'composite' gives a blank table. The code below lays out sections one and two (figure A) then updates section two (figure B).\r\n\r\n\r\n{code}\r\nvar self = Titanium.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\n\r\nvar tableView = Titanium.UI.createTableView({\r\n top : 20\r\n});\r\nvar sectiondata = [];\r\nvar oneSection = Ti.UI.createTableViewSection();\r\n\r\nvar one_header_row = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar one_header = Ti.UI.createView({\r\n backgroundColor : 'silver',\r\n height : 30\r\n});\r\n\r\nvar l_oneHeader = Ti.UI.createLabel({\r\n text : 'One',\r\n font : {\r\n fontSize : 18\r\n },\r\n color : 'white',\r\n height : 30,\r\n left : 10\r\n});\r\n\r\none_header.add(l_oneHeader);\r\none_header_row.add(one_header);\r\noneSection.add(one_header_row);\r\n\r\nvar itemRow_one = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar l_a_one = Titanium.UI.createLabel({\r\n color : 'blue',\r\n text : '1',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_one.add(l_a_one);\r\n\r\nvar l_b_one = Titanium.UI.createLabel({\r\n color : 'green',\r\n text : 'Label',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_one.add(l_b_one);\r\n\r\nvar l_c_one = Titanium.UI.createLabel({\r\n text : 'Description text',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_one.add(l_c_one);\r\noneSection.add(itemRow_one);\r\nsectiondata.push(oneSection);\r\n\r\nvar twoSection = Ti.UI.createTableViewSection();\r\n\r\nvar two_header_row = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar two_header = Ti.UI.createView({\r\n backgroundColor : 'silver',\r\n height : 30\r\n});\r\n\r\nvar l_twoHeader = Ti.UI.createLabel({\r\n text : 'Two',\r\n font : {\r\n fontSize : 18\r\n },\r\n color : 'white',\r\n height : 30,\r\n left : 10\r\n});\r\n\r\ntwo_header.add(l_twoHeader);\r\ntwo_header_row.add(two_header);\r\ntwoSection.add(two_header_row);\r\n\r\nvar itemRow_two = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar l_a_two = Titanium.UI.createLabel({\r\n color : 'blue',\r\n text : '1',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_two.add(l_a_two);\r\n\r\nvar l_b_two = Titanium.UI.createLabel({\r\n color : 'green',\r\n text : 'Label',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_two.add(l_b_two);\r\n\r\nvar l_c_two = Titanium.UI.createLabel({\r\n text : 'Description text',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_two.add(l_c_two);\r\n\r\ntwoSection.add(itemRow_two);\r\nsectiondata.push(twoSection);\r\ntableView.setData(sectiondata);\r\n\r\n/*\r\n * UPDATE THE SECTION WE JUST CREATED\r\n * Use the exact same table info as the first two sections and use updateSection\r\n */\r\n\r\nvar updatedSection = Ti.UI.createTableViewSection();\r\n\r\nvar updated_header_row = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar updated_header = Ti.UI.createView({\r\n backgroundColor : 'silver',\r\n height : 30\r\n});\r\n\r\nvar l_updatedHeader = Ti.UI.createLabel({\r\n text : 'Two',\r\n font : {\r\n fontSize : 18\r\n },\r\n color : 'white',\r\n height : 30,\r\n left : 10\r\n});\r\n\r\nupdated_header.add(l_updatedHeader);\r\nupdated_header_row.add(updated_header);\r\nupdatedSection.add(updated_header_row);\r\n\r\nvar itemRow_updated = Ti.UI.createTableViewRow({\r\n layout : 'horizontal'\r\n});\r\n\r\nvar l_a_updated = Titanium.UI.createLabel({\r\n color : 'blue',\r\n text : '1',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_updated.add(l_a_updated);\r\n\r\nvar l_b_updated = Titanium.UI.createLabel({\r\n color : 'green',\r\n text : 'Label',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_updated.add(l_b_updated);\r\n\r\nvar l_c_updated = Titanium.UI.createLabel({\r\n text : 'Description text',\r\n height : 40,\r\n left : 10\r\n});\r\nitemRow_updated.add(l_c_updated);\r\n\r\nupdatedSection.add(itemRow_updated);\r\n\r\ntableView.updateSection(updatedSection, 1);\r\n\r\nself.add(tableView);\r\nself.open();\r\n{code}\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "attachment": [ { "id": "46006", "filename": "figure A.png", "author": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-18T21:40:08.000+0000", "size": 30092, "mimeType": "image/png" }, { "id": "46007", "filename": "figure B.png", "author": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-18T21:40:08.000+0000", "size": 29789, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Layout does not work when using TableView updateSection", "creator": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 3.2.1.201402041146\r\nSDK 3.2.1 GA", "comment": { "comments": [ { "id": "293489", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please provide a runnable test case to reproduce this issue. I tried to run the provided test but it complains of undefined variables and rightly so.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-18T04:35:21.000+0000", "updated": "2014-02-18T04:35:21.000+0000" }, { "id": "293643", "author": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have updated to code to provide a runnable test.", "updateAuthor": { "name": "giantfrog", "key": "giantfrog", "displayName": "Douglas Turner", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-18T21:44:42.000+0000", "updated": "2014-02-18T21:44:42.000+0000" }, { "id": "293892", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce this issue with provided test case. It appears that updateSection method does not work correctly with the layouts.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-20T04:56:39.000+0000", "updated": "2014-02-20T04:56:39.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }