{ "id": "124705", "key": "AC-2278", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2014-01-12T19:17:21.000+0000", "created": "2014-01-12T16:52:23.000+0000", "labels": [], "versions": [], "issuelinks": [ { "id": "34251", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "123964", "key": "TIMOB-16079", "fields": { "summary": "Android: Incorrect e.itemIndex for ListView and SearchBar", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:17.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": [], "description": "h3. Steps to Reproduce\nRun this code:\n\n{code:JavaScript}\nvar items = ['one', 'two', 'three', 'four', 'five'];\nvar data = [];\nfor (var i = 0; i < items.length; ++i) {\n data.push( { properties: {\n itemId: i,\n title: items[i],\n searchableText: items[i],\n } } );\n}\nvar section = Titanium.UI.createListSection();\nsection.setItems(data);\nvar listView = Titanium.UI.createListView({\n canScroll: true,\n caseInsensitiveSearch: true,\n searchView: Titanium.UI.createSearchBar({\n top: 0,\n left: 0,\n height: 45,\n showCancel: false,\n }),\n sections: [section],\n});\nlistView.addEventListener('itemclick', function (e) {\n Titanium.API.trace('itemclick from listView: e.itemIndex = ' + JSON.stringify(e.itemIndex) + ', e.sectionIndex = ' + JSON.stringify(e.sectionIndex) + ', e.itemId = ' + JSON.stringify(e.itemId) );\n});\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\nwin.add(listView);\nwin.open();\n\n// ANDROID 4.1.1/Titanium 3.2.0: When a listview is filtered, itemId remains unchanged, but itemIndex is the index of the filtered content (e.g. always 0 if you've filtered down to one thing).\n// iOS 7.0.3/Titanium 3.2.0: When a listview is filtered, itemIndex continues to reference the unfiltered list.\n{code}\n\nh3. Actual Result\nANDROID 4.1.1/Titanium 3.2.0: When a listview is filtered, itemId remains unchanged, but itemIndex is the index of the filtered content (e.g. always 0 if you've filtered down to one thing).\n\niOS 7.0.3/Titanium 3.2.0: When a listview is filtered, itemIndex continues to reference the unfiltered list.\n\n\nh3. Expected Result\nSame result on both platforms.\n(The obvious workaround is to use itemId, which is consistent.)", "attachment": [ { "id": "45060", "filename": ".log", "author": { "name": "rudolf@pobox.com", "key": "rudolf@pobox.com", "displayName": "Rudolf Cardinal", "active": true, "timeZone": "Europe/London" }, "created": "2014-01-12T16:52:35.000+0000", "size": 5822040, "mimeType": "text/plain" }, { "id": "45061", "filename": "diagnostic1541366633337341993.log", "author": { "name": "rudolf@pobox.com", "key": "rudolf@pobox.com", "displayName": "Rudolf Cardinal", "active": true, "timeZone": "Europe/London" }, "created": "2014-01-12T16:52:42.000+0000", "size": 15690, "mimeType": "text/plain" } ], "flagged": false, "summary": "ListView itemclick event itemIndex inconsistent between Android and iOS", "creator": { "name": "rudolf@pobox.com", "key": "rudolf@pobox.com", "displayName": "Rudolf Cardinal", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "rudolf@pobox.com", "key": "rudolf@pobox.com", "displayName": "Rudolf Cardinal", "active": true, "timeZone": "Europe/London" }, "environment": "Titanium Studio 3.2.0", "comment": { "comments": [ { "id": "287909", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving this ticket as a duplicate of TIMOB-16079. Please track that ticket for further updates.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-12T19:17:22.000+0000", "updated": "2014-01-12T19:17:22.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }