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

Alloy, SearchView not filtering TableView on Android

$
0
0

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.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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