{ "id": "161789", "key": "TIMOB-23639", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-07-18T01:23:22.000+0000", "created": "2016-07-14T17:15:25.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-5.4.0" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-09-06T14:48:45.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen calling updateSection for a tableviewsection with the index number that once referenced a deleted section, it appears that the deleted section is updated and readded to the tableview.\r\n\r\nThe code below does the following:\r\n\r\n# Create a tableview with two sections\r\n# When the window opens, delete the section at index 1 and append a new section\r\n# When a tableviewrow is clicked, update the section at index\r\n\r\nOn Android and iOS this code works as expected, with the title of the 2 section being updated\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar sectionFruit = Ti.UI.createTableViewSection({ \r\n\theaderTitle: 'Fruit'\r\n});\r\nsectionFruit.add(Ti.UI.createTableViewRow({ title: 'Apples' }));\r\nsectionFruit.add(Ti.UI.createTableViewRow({ title: 'Bananas' }));\r\n\r\nvar testSection = Ti.UI.createTableViewSection({ \r\n\theaderTitle: 'Test'\r\n});\r\n\r\nvar table = Ti.UI.createTableView({\r\n\tdata: [sectionFruit, testSection]\r\n});\r\n\r\nwin.addEventListener('open', function() {\r\n\ttable.deleteSection(1);\r\n\ttable.appendSection(createSection('newSection'));\r\n\tvar sections = table.sections;\r\n\tfor(var i = 0; i < sections.length; i++) {\r\n\t\tconsole.log(sections[i].headerTitle);\r\n\t}\r\n});\r\n\r\ntable.addEventListener('click', function() {\r\n\ttable.updateSection(1, createSection('updateSection'));\r\n\tvar sections2 = table.sections;\r\n\tconsole.log(table.sections.length);\r\n\tfor(var i = 0; i < sections2.length; i++){\r\n\t\tconsole.log(sections2[i].headerTitle);\r\n\t}\r\n});\r\n\r\nfunction createSection(title){\r\n\treturn section = Ti.UI.createTableViewSection({ headerTitle: title});\r\n}\r\n\r\nwin.add(table);\r\nwin.open();\r\n{code}\r\n\r\nh5.Steps to reproduce\r\n\r\n1. Using the code above, build for Windows Platform using {{appc run -p windows -T wp-emulator}}\r\n2. Tap one of the rows in the first section\r\n\r\nh5.Actual result\r\n\r\nThere are now 3 sections Fruit, updateSection and newSection\r\n\r\nh5.Expected result\r\n\r\nThere should only be 2 sections Fruit and updateSection ", "attachment": [], "flagged": false, "summary": "Windows: Updating a tableviewsection with the index of a deleted tableviewsection adds the deleted tableviewsection back", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Windows 10 Pro\r\nAppc CLI Core: 5.4.0-33\r\nAppc CLI NPM: 4.2.7\r\nTi SDK: 5.4.0.v20160713141635\r\nAppc Studio: 4.7.0.201607111053", "closedSprints": [ { "id": 682, "state": "closed", "name": "2016 Sprint 15 SDK", "startDate": "2016-07-16T00:19:20.819Z", "endDate": "2016-07-30T00:19:00.000Z", "completeDate": "2016-08-01T04:40:11.421Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "390793", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-15T13:17:35.000+0000", "updated": "2016-07-15T13:17:35.000+0000" }, { "id": "395396", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-38\r\nAppc NPM: 4.2.8-6\r\nTi SDK: 6.0.0.v20160904203840\r\nLumia 930: 10.0\r\n\r\nDemo code in the description now works as expected\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-09-06T14:48:38.000+0000", "updated": "2016-09-06T14:48:38.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }