{"action":"created","issue":{"url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/6987","labels_url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/6987/labels{/name}","comments_url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/6987/comments","events_url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/6987/events","html_url":"https://github.com/appcelerator/titanium_mobile/pull/6987","id":97609278,"number":6987,"title":"[TIMOB-19200] Android: implement 'noresults' event on ListView","user":{"login":"ashcoding","id":9311952,"avatar_url":"https://avatars.githubusercontent.com/u/9311952?v=3","gravatar_id":"","url":"https://api.github.com/users/ashcoding","html_url":"https://github.com/ashcoding","followers_url":"https://api.github.com/users/ashcoding/followers","following_url":"https://api.github.com/users/ashcoding/following{/other_user}","gists_url":"https://api.github.com/users/ashcoding/gists{/gist_id}","starred_url":"https://api.github.com/users/ashcoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashcoding/subscriptions","organizations_url":"https://api.github.com/users/ashcoding/orgs","repos_url":"https://api.github.com/users/ashcoding/repos","events_url":"https://api.github.com/users/ashcoding/events{/privacy}","received_events_url":"https://api.github.com/users/ashcoding/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-28T03:55:45Z","updated_at":"2015-07-28T20:59:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/appcelerator/titanium_mobile/pulls/6987","html_url":"https://github.com/appcelerator/titanium_mobile/pull/6987","diff_url":"https://github.com/appcelerator/titanium_mobile/pull/6987.diff","patch_url":"https://github.com/appcelerator/titanium_mobile/pull/6987.patch"},"body":"Jira: https://jira.appcelerator.org/browse/TIMOB-19200\r\n\r\nTest code for listview:\r\n```javascript\r\nvar win = Ti.UI.createWindow({backgroundColor: 'grey', fullscreen: true});\r\nvar search = Titanium.UI.createSearchBar({\r\n barColor:'#000', \r\n showCancel:true,\r\n height:43,\r\n top:0,\r\n});\r\nsearch.addEventListener('cancel', function(){\r\n    search.blur();\r\n});\r\n// for textSearch, use the change event to update the search value\r\n// search.addEventListener('change', function(e){\r\n//     listView.searchText = e.value;\r\n// });\r\nvar listView = Ti.UI.createListView({searchView: search, caseInsensitiveSearch: true});\r\n// for textSearch, add the search bar or text field as a header view\r\n// var listView = Ti.UI.createListView({headerView: search, caseInsensitiveSearch: true});\r\nvar listSection = Ti.UI.createListSection();\r\nvar fruits = ['Papaya', 'Peach', 'Pear', 'Persimmon', 'Pineapple', 'Pluot', 'Pomegranate'];\r\nvar data = [];\r\nfor (var i = 0; i < fruits.length; i++) {\r\ndata.push({\r\n    properties: {title: fruits[i], searchableText: fruits[i]}\r\n});\r\n}\r\nlistSection.setItems(data);\r\nlistView.addEventListener('noresults', function(e){\r\n    alert(\"No results found!\");\r\n});\r\nlistView.sections = [listSection];\r\nwin.add(listView);\r\nwin.open();\r\n```\r\n\r\nTest code for tableview:\r\n```javascript\r\nvar win = Ti.UI.createWindow({\r\n    backgroundColor: 'blue',\r\n    fullscreen: false\r\n});\r\n\r\n// Use action bar search view\r\nvar search = Ti.UI.Android.createSearchView({\r\n    hintText: \"Table Search\"\r\n});\r\n\r\nwin.activity.onCreateOptionsMenu = function(e) {\r\n    var menu = e.menu;\r\n    var menuItem = menu.add({\r\n        title: 'Table Search',\r\n        actionView : search,\r\n        icon: (Ti.Android.R.drawable.ic_menu_search ? Ti.Android.R.drawable.ic_menu_search : \"my_search.png\"),\r\n        showAsAction: Ti.Android.SHOW_AS_ACTION_IF_ROOM | Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW\r\n    });\r\n};\r\n\r\nvar data = [];\r\ndata.push(Ti.UI.createTableViewRow({title:'Apple'}));\r\ndata.push(Ti.UI.createTableViewRow({title:'Banana'}));\r\ndata.push(Ti.UI.createTableViewRow({title:'Orange'}));\r\ndata.push(Ti.UI.createTableViewRow({title:'Raspberry'}));\r\n\r\nvar tableview = Titanium.UI.createTableView({\r\n    data: data,\r\n    search: search,\r\n    searchAsChild: false\r\n});\r\n\r\ntableview.addEventListener('noresults', function(e){\r\n    alert(\"No results found!\");\r\n});\r\n\r\nwin.add(tableview);\r\nwin.open();\r\n```"},"comment":{"url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/comments/125752404","html_url":"https://github.com/appcelerator/titanium_mobile/pull/6987#issuecomment-125752404","issue_url":"https://api.github.com/repos/appcelerator/titanium_mobile/issues/6987","id":125752404,"user":{"login":"hieupham007","id":1141803,"avatar_url":"https://avatars.githubusercontent.com/u/1141803?v=3","gravatar_id":"","url":"https://api.github.com/users/hieupham007","html_url":"https://github.com/hieupham007","followers_url":"https://api.github.com/users/hieupham007/followers","following_url":"https://api.github.com/users/hieupham007/following{/other_user}","gists_url":"https://api.github.com/users/hieupham007/gists{/gist_id}","starred_url":"https://api.github.com/users/hieupham007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hieupham007/subscriptions","organizations_url":"https://api.github.com/users/hieupham007/orgs","repos_url":"https://api.github.com/users/hieupham007/repos","events_url":"https://api.github.com/users/hieupham007/events{/privacy}","received_events_url":"https://api.github.com/users/hieupham007/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T20:59:12Z","updated_at":"2015-07-28T20:59:12Z","body":"Code reviewed and functionally tested. Looks good, just a minor comment"}}