[TIMOB-4591] Search icon in filter doesn't show searchbar on tap
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-11-11T20:30:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | api |
Reporter | Doney den Ouden |
Assignee | Ingo Muschenetz |
Created | 2011-06-09T11:37:38.000+0000 |
Updated | 2017-03-20T22:35:47.000+0000 |
Description
When adding a search icon to the filter/index in a TableView (see screenshot) using
title:'{search}'
as the title, the searchbar isn't focused (which would be expected behaviour) when tapped. Also, the filter/index should be under the searchbar, not on top of it.
Ti.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
title:'Tableview with Filter',
backgroundColor:'#fff'
});
var search = Ti.UI.createSearchBar({
hintText:'Search',
showCancel:false
});
var data = [];
for (var c=0;c<=20;c++) {
data.push({title:"Row "+c});
}
var indexArray = [
{title:'{search}'},
{title:'A'},
{title:'B'},
{title:'C'},
{title:'D'},
{title:'E'},
{title:'F'},
{title:'G'},
{title:'H'},
{title:'I'},
{title:'K'},
{title:'L'},
{title:'M'},
{title:'N'},
{title:'O'},
{title:'P'},
{title:'Q'},
{title:'R'},
{title:'S'},
{title:'T'},
{title:'U'},
{title:'V'},
{title:'W'}
];
var tableview = Ti.UI.createTableView({
search:search,
data:data,
index:indexArray
});
win.add(tableview);
win.open();
Attachments
File | Date | Size |
---|---|---|
search.png | 2011-06-09T11:37:38.000+0000 | 48391 |
Search.zip | 2011-06-25T04:32:41.000+0000 | 1578228 |
In order for us to progress this issue, please edit your ticket to include a proper [Use-case](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases). State your environment, including whether you have tested on device or simulator, Titanium SDK version + build date + commit hash, and the iOS version. Also kindly read the [Submitting Bug Reports](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports) guide before raising tickets. Thank you
No response from user
Excuse me for replying so late, in all honesty I forgot to reply. Added more info and a test case. I'm not sure about committing the hash you asked for.
Doney Would you please state where you have seen an official example of the index property used in this way? If it's a valid use, then we need to know in order to get it documented. Once we have established that, we can take this further. Thanks
btw, please don't attach a whole project for such a simple usecase. A simple code block will suffice. Thanks
Here is an example of official use. Apple uses it in first party apps like the Contacts and iPod apps: http://cl.ly/2H2g0D2U2s0k3u24460p
Doney OK, but bear in mind that not all Apple features are necessarily supported by Titanium, although our aim is to get close to total coverage. One member of our team, Pedro, has actually done some work on this, after discovering a problem with the function himself. See his fixed [TiUITableView.m](https://gist.github.com/fcee08050552fe9a7017) file, where lines 1798 to 1802 of the original have been modified. Pedro suggests testing it with [this usecase](https://gist.github.com/912054). Moving this ticket to TIMOB project to action fix.
Note that a request to add information to the APIDocs about the index function has been made at TIMOB-4592
Closing ticket as duplicate.