Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6949] Android: UI - table filter does not hide empty headers

GitHub Issuen/a
TypeBug
PriorityLow
StatusIn Review
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsparity, tbs-1.9.0
ReporterSindre Sorhus
AssigneeUnknown
Created2011-11-17T07:05:24.000+0000
Updated2018-03-06T18:57:58.000+0000

Description

Problem

On Android, filtering a table displays all the headers, even though some contain no rows. It should only display the headers of the matching table rows. This works correctly on iOS - see the attached screenshots which show the difference between the two platforms.

Testcase

Write "a" in the searchbar and you'll also see the "b" and "c" headers, even though they don't have any items.
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow();

var table = Ti.UI.createTableView({
  search: Ti.UI.createSearchBar(),
  filterAttribute:'title',
  filterCaseInsensitive:true,
  data: [
    {
      title: 'a',
      header: 'a'
    },
    {
      title: 'b',
      header: 'b'
    },
    {
      title: 'c',
      header: 'c'
    }
  ]
});
win.add(table);
win.open();

Attachments

FileDateSize
iOS Simulator.png2012-01-02T08:14:11.000+0000165792
screenshot_463.png2012-01-02T06:50:46.000+000019651

Comments

  1. Paul Dowsett 2011-12-26

    Sindre Thanks for raising this ticket. In order for me to escalate it to the core team, all the fields must be complete. Please check it against the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist), and add any missing information. A test case must be included, and run without modification, as per the [Creating a Test Case](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase) section. I will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project. Cheers
  2. Sindre Sorhus 2012-01-02

    Added testcase. Please reopen.
  3. Biju pm 2013-08-05

    PR:- https://github.com/appcelerator/titanium_mobile/pull/4523
  4. Biju pm 2013-10-07

    new PR : https://github.com/appcelerator/titanium_mobile/pull/4764
  5. Biju pm 2014-02-14

    create new PR :- https://github.com/appcelerator/titanium_mobile/pull/5353

JSON Source