I am having issues on Android trying to get a SearchView to filter the results of my TableView. For iOS I am using a Ti.UI.SearchBar and the filtering works fine. On Android I am using a Ti.UI.Android.SearchView and the results don't seem to filter when I start typing.
My XML for the TableView and SearchView is
<TableView id="slideList"> <SearchView ns="Ti.UI.Android" id="searchBar" iconifiedByDefault="false" /> </TableView>In my controller I generate the
TableView data through a loop and create a widget which is simply a TableViewRow with some custom props (specifically a prop called searchFilter).
function parseData(slides) { for (i = 0; i < slides.length; i++) { var row = Alloy.createWidget('com.dop.vforummobile.sliderow'); row.init(slides[i], i); $.slideList.appendRow(row.getView()); } $.slideList.search = $.searchBar; //-- Tie the SearchView to the TableView $.slideList.filterAttribute = 'searchFilter'; //-- searchFilter prop on my widget }My Widget (this shows I am setting a
searchFilter property on the row):var init = function(data, index) { $.title.text = (index + 1) + '. ' + data.title; $.slideRow.startTime = data.startTime; $.slideRow.searchFilter = data.title + ' ' + data.slideText; }; exports.init = init;I have verified that
data.title and data.slideText do contain text.