{ "id": "76555", "key": "TIMOB-4456", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [], "resolution": null, "resolutiondate": null, "created": "2011-06-20T08:24:15.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-04-13T20:11:07.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Add the ability to do the following:\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor:'white'});\r\nvar searchBar = Ti.UI.createSearchBar();\r\nvar tableview = Ti.UI.createTableView({\r\n\tsearch: searchBar\r\n});\r\nwin.add(tableview);\r\nsetTimeout( function() {\r\n\tsearchBar.focus();\r\n\tsetTimeout( function() {\r\n\t searchBar.value = 'dog';\r\n\t}, 500);\r\n}, 500);\r\nsetTimeout( function() {\r\n\talert('fired!');\r\n \r\n // This is the method desired\r\n\tsearchBar.cancel();\r\n}, 3000);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Add cancel method to searchBar in a table view", "creator": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "157290", "author": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "body": "// With this code you can hide the SearchBar added in a TableView if you switch to another Tab\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\n var tabGroup = Titanium.UI.createTabGroup();\r\n \r\n var win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n });\r\n win1.addEventListener('focus', function(){\r\n tableview.searchHidden = false;\r\n });\r\n \r\n var tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n });\r\n \r\n var searchBar = Ti.UI.createSearchBar({\r\n cancel:false\r\n });\r\n \r\n var tableview = Ti.UI.createTableView({\r\n search: searchBar,\r\n data:[{title:'dog'},{title:\"cat\"},{title:\"bird\"}]\r\n });\r\n \r\n win1.add(tableview);\r\n \r\n var win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n });\r\n win2.addEventListener('focus', function(){\r\n tableview.searchHidden = true;\r\n });\r\n \r\n var tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n });\r\n \r\n var label2 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 2',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n });\r\n \r\n win2.add(label2);\r\n \r\n tableview.addEventListener('click', function (e){\r\n alert(\"Index \" + e.index + \" \\n\" + e.rowData.title);\r\n });\r\n \r\n tabGroup.addTab(tab1); \r\n tabGroup.addTab(tab2); \r\n \r\n tabGroup.open();", "updateAuthor": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-21T11:11:05.000+0000", "updated": "2011-06-21T11:11:05.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }