{ "id": "87269", "key": "TIMOB-7861", "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": "12097", "description": "", "name": "Sprint 2012-05", "archived": true, "released": true, "releaseDate": "2012-03-11" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13270", "description": "Release 1.8 Service Pack 3 (CI for 1_8_X)", "name": "Release 1.8.3", "archived": true, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-03-29T07:57:12.000+0000", "created": "2012-03-01T21:25:13.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_tableview", "qe-testadded" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-03-29T15:56:21.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": "This is the case where a tableview is associated with a searchBar. When table rows are filtered using some search text and then new data, with headers, is set to the table on clicking the search button on keyboard ('return' function of the searchBar), then the search filter is applied on the new data but then the headers are also displayed which results in weird display.\r\n\r\nPlease see the attached images for better understanding.\r\n\r\n*Sample Code*\r\n{noformat}\r\n// create table view data object\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\n\r\nvar data = [\r\n {title:'Alan (click to change index)', hasChild:true, header:'A'},\r\n {title:'Alice', hasDetail:true},\r\n {title:'Alexander'},\r\n {title:'Amos'},\r\n {title:'Alonzo'},\r\n {title:'Brad', header:'B'},\r\n {title:'Brent'},\r\n {title:'Billy'},\r\n {title:'Brenda'},\r\n {title:'Callie', header:'C'},\r\n {title:'Cassie'},\r\n {title:'Chris'},\r\n {title:'Cameron'},\r\n {title:'Don', header:'D'},\r\n {title:'Dilbert'},\r\n {title:'Deacon'},\r\n {title:'Devin'},\r\n {title:'Darin'},\r\n {title:'Darcy'}\r\n];\r\n\r\nvar search = Titanium.UI.createSearchBar();\r\n\r\n// create table view\r\nvar tableview = Titanium.UI.createTableView({\r\n data:data,\r\n search:search,\r\n filterAttribute : 'title'\r\n});\r\n\r\n// set filters\r\nvar index = [\r\n {title:'A',index:0},\r\n {title:'B',index:5},\r\n {title:'C',index:9},\r\n {title:'D',index:(data.length -1)}\r\n];\r\ntableview.index = index;\r\n\r\n// add table view to the window\r\nwin.add(tableview);\r\n\r\nsearch.addEventListener('return', function() {\r\n \r\n tableview.setData(data);\r\n \r\n});\r\n\r\nwin.open();\r\n{noformat}\r\n\r\n*Steps to Reproduce*\r\n- Please copy the code into app.js and run the app.\r\n- Search for a name in the table, say 'Chr'.\r\n- Hit Enter if running on simulator or search if running on device.\r\n- You can see new data with search filter and also the headers.\r\n\r\n*Expected Behavior*\r\n- New data is filtered and no headers are seen\r\n\r\n*Other comments*\r\n- The use case is to apply new data, but not the original data again. It was only used for the example.", "attachment": [ { "id": "26002", "filename": "Search button is hit and new data is applied.png", "author": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-01T21:25:13.000+0000", "size": 71738, "mimeType": "image/png" }, { "id": "26001", "filename": "Search filter applied.png", "author": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-01T21:25:13.000+0000", "size": 101872, "mimeType": "image/png" }, { "id": "26000", "filename": "Tableview with data.png", "author": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-01T21:25:13.000+0000", "size": 79897, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Tableview headers incorrect display when combined with searchBar", "creator": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sbhimavarapu", "key": "sbhimavarapu", "displayName": "Sandeep Bhimavarapu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Product: Titanium Mobile\r\nTitanium SDK: 1.8.2\r\nHost OS: Mac OS X Lion\r\nPlatform OS: iOS\r\nPlatform OS Version: 5.0", "comment": { "comments": [ { "id": "185460", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a common iOS issue when UITableView with sections is updated when UISearchDisplayController is active.\r\nhttp://stackoverflow.com/questions/3647319/reloading-uitableview-behind-uisearchdisplaycontroller\r\n", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-07T16:50:28.000+0000", "updated": "2012-03-07T16:50:28.000+0000" }, { "id": "185780", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 1.0.9.201202141208\r\nTi Mob SDK 2.0.0.v20120309100238\r\nOSX Lion 10.7.3\r\n\r\nExpected behavior is shown of no headers being displayed after searching ", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-09T10:48:28.000+0000", "updated": "2012-03-09T10:48:28.000+0000" }, { "id": "189120", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to add 1.8.3 to fixversion", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-29T07:56:44.000+0000", "updated": "2012-03-29T07:56:44.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }