Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

SearchBar in Tableview make tableview inaccessible

$
0
0

Hi all I create a searchBar attached to a tableview. It works fine.

But when I click on the searchBar, the tableview is inaccessible, so I cannot choose any row before typing the first letter in the searchbar.

What I need is - when I click on the searchbar (focus on it and keyboard visible) - to be able to choose a row even if I didn't type anything yet

Sample code I use now :

var win = Titanium.UI.currentWindow;
 
// create table view data object
var data = [];
 
data[0] = Ti.UI.createTableViewRow({title:'John AppleSeed', id:'100'});
data[1] = Ti.UI.createTableViewRow({title:'John', id:'101'});
data[2] = Ti.UI.createTableViewRow({title:'Mark', id:'102'});
data[3] = Ti.UI.createTableViewRow({title:'Paul', id:'103'});
 
var search = Titanium.UI.createSearchBar({
    showCancel:false,
    hintText:'Search Customer'
});
search.addEventListener('change', function(e)
{
   e.value // search string as user types
});
search.addEventListener('return', function(e)
{
   search.blur();
});
search.addEventListener('cancel', function(e)
{
   search.blur();
});
 
// create table view
var tableview = Titanium.UI.createTableView({
    data:data,
    search:search
 
});
 
    win.add(tableview);
Is it possible to do so ?

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>