{ "id": "163888", "key": "TIMOB-24019", "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-10-18T17:27:12.000+0000", "created": "2016-10-11T22:45:40.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-10-21T22:36:09.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. Issue Description \r\n\r\nListitems do not maintain item index on search filter\r\n\r\nh5. Steps to reproduce\r\n# Download and run the project \r\n# Search by number 0-11 (the list should filter down to just that number)\r\n# Click on the list item with the number (alert with itemindex should pop up)\r\n\r\nExpected: the itemindex matches the item's position in the list\r\nActual: the itemindex is 0 because the list has been filtered down to one item.", "attachment": [ { "id": "60493", "filename": "listSearchCase (1).zip", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T22:45:38.000+0000", "size": 10483730, "mimeType": "application/zip" } ], "flagged": false, "summary": "Windows: Listitems do not maintain itemindex when filtered", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti sdk 6.0.0.v20160803030826\r\nWindows ", "closedSprints": [ { "id": 733, "state": "closed", "name": "2016 Sprint 21 SDK", "startDate": "2016-10-08T00:53:00.000Z", "endDate": "2016-10-22T00:53:00.000Z", "completeDate": "2016-10-24T03:58:08.547Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "398632", "author": { "name": "pclark", "key": "pkclark", "displayName": "Patrick Clark", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rramirez] is APPTS the correct project for this ticket?", "updateAuthor": { "name": "pclark", "key": "pkclark", "displayName": "Patrick Clark", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T22:49:06.000+0000", "updated": "2016-10-11T22:49:06.000+0000" }, { "id": "398811", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "ok confirmed that this is a bug, started work on it. We needed to keep \"original\" data and indexes. What I also noticed is that {{ListView.sections}} does not keep the original data, which is a bug too. But one good thing here is that you can actually get the clicked data content by getting {{ListView.sections\\[e.sectionIndex\\].items\\[e.itemIndex\\]}} because of that. [~rramirez] Do you think you can workaround it by accessing {{sections}} and {{section.items}} directly like below?\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' });\r\nvar searchText = Ti.UI.createTextField({ width: Ti.UI.FILL, height: '10%' });\r\n\r\nvar listView = Ti.UI.createListView({ width: Ti.UI.FILL, height: '90%', caseInsensitiveSearch: true });\r\nvar sections = [];\r\n\r\nvar fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits' });\r\nvar fruitDataSet = [\r\n { properties: { title: 'Apple', searchableText: 'Apple' } },\r\n { properties: { title: 'Banana', searchableText: 'Banana' } },\r\n];\r\nfruitSection.setItems(fruitDataSet);\r\nsections.push(fruitSection);\r\n\r\nvar vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables' });\r\nvar vegDataSet = [\r\n { properties: { title: 'Carrots', searchableText: 'Carrots' } },\r\n { properties: { title: 'Potatoes', searchableText: 'Potatoes' } },\r\n];\r\nvegSection.setItems(vegDataSet);\r\nsections.push(vegSection);\r\n\r\nlistView.sections = sections;\r\n\r\nsearchText.addEventListener('change', function () {\r\n listView.searchText = searchText.value;\r\n});\r\n\r\nlistView.addEventListener('itemclick', function (evt) {\r\n var clickItemIndex = evt.itemIndex;\r\n var clickSectionIndex = evt.sectionIndex;\r\n\r\n alert(listView.sections[clickSectionIndex].items[clickItemIndex].properties.title);\r\n});\r\n\r\nwin.add(searchText);\r\nwin.add(listView);\r\nwin.open();\r\n{code}\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-13T08:08:18.000+0000", "updated": "2016-10-13T08:08:18.000+0000" }, { "id": "399206", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/881", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-18T08:32:06.000+0000", "updated": "2016-10-18T08:32:06.000+0000" }, { "id": "399571", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This should be on 6_0_X now. Check out {{6.0.0.v20161021034759}}.\r\n\r\n{code}\r\n appc ti sdk install --branch 6_0_X 6.0.0.v20161021034759\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-21T12:25:04.000+0000", "updated": "2016-10-21T12:25:04.000+0000" }, { "id": "399581", "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-63\r\nAppc NPM: 4.2.8-9\r\nTi SDK: 6.0.0.v20161021034759\r\nLumia 550 10.0\r\n\r\ne.itemIndex now corresponds to the values in the original listview and not the filtered listview. Provided test case now works as expected \r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-10-21T15:17:14.000+0000", "updated": "2016-10-21T15:17:14.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }