{ "id": "61172", "key": "TIMOB-540", "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": "11363", "description": "Mobile 1.8.0 M10", "name": "Sprint 2011-31", "archived": true, "released": true, "releaseDate": "2011-08-08" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-27T15:52:02.000+0000", "created": "2011-04-15T02:31:27.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "tableview", "tableviewrow" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" }, { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-10-27T15:52:02.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": "h1. Problem\r\ninsertRowBefore adds rows at the incorrect spot.\r\n\r\nh2. Reproduction\r\nDrop the following in an app.js.\r\n1. It has a table with two rows: A and C.\r\n2. It attempts to insert a row B before C.\r\n3. The rows end up being BAC, instead of the expected ABC.\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\nwin.open();\r\n\r\nvar data = [\r\n { title: 'A', name: 'A' },\r\n { title: 'C', name: 'C' }\r\n];\r\n\r\nvar tableview = Ti.UI.createTableView({ data: data });\r\nwin.add(tableview);\r\n\r\nfunction checkIndex(name, expected) {\r\n var actual = tableview.getIndexByName(name);\r\n Ti.API.info(name + \"'s Index: \" + actual);\r\n if (actual != expected) {\r\n alert(name + ' has an inaccurate index! expected: ' + expected + ', actual: ' + actual);\r\n }\r\n}\r\n\r\nsetTimeout(function() {\r\n tableview.insertRowBefore(tableview.getIndexByName('C'), { title: 'B', name: 'B' });\r\n\r\n checkIndex('A', 0);\r\n checkIndex('B', 1);\r\n checkIndex('C', 2);\r\n}, 1000);\r\n{code}\r\n\r\nh2. Expected Behavior\r\nCalling \"insertRowBefore\" a row should insert the row before the specified row. It should _not_ insert the row two rows before the specified row.", "attachment": [], "flagged": false, "summary": "Tableview.insertRowBefore(index, row, options) Inserts in wrong Index", "creator": { "name": "dukz", "key": "dukz", "displayName": "dukz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "123512", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}
This is expected behavior.