searchbar using textbox for tableview...

You must Login before you can answer or comment on any questions.

Hi, I am using titanium sdk version 2.1.0.GA IOS simulator host operating system is MacOS. Titanium Studio, build: 2.1.0.201206251749. i am trying to add a searchbar on the tableview...but i dont want that searchbar to scroll when i scroll the table.. i tried using textbox for search...is there any way i can perform a search on the table using that textbox.. here is my current code..

var search = Titanium.UI.createTextField({
    color:'#336699',
    top:0,
    left:10,
    width:300,
    height:40,
    hintText:'Search for ...',
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
    returnKeyType:Titanium.UI.RETURNKEY_DEFAULT
});
 
LocWin.add(search);
var aTableView = Ti.UI.createTableView({
        backgroundColor : 'transparent',
        top : 50,
        height : Ti.UI.FILL,
        style : Ti.UI.iPhone.TableViewStyle.PLAIN,
        width : Ti.UI.FILL,
        //search:search,
    });
LocWin.add(aTableView);
Thanks for any help..

1 Answer

From Ti.UI.SearchBar

A search bar can also be used without a table view.

— answered 10 months ago by Stephen Feather
answer permalink
2 Comments
  • var search = Titanium.UI.createTextField({
        color:'#336699',
        top:0,
        left:10,
        width:300,
        height:40,
        hintText:'Search for ...',
        borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
        keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
        returnKeyType:Titanium.UI.RETURNKEY_DEFAULT
    });
    LocWin.add(search);

    — commented 10 months ago by Stephen Feather

  • Take a look at Search Outside Tableview for guidance on manipulating the table data.

    — commented 10 months ago by Stephen Feather

Your Answer

Think you can help? Login to answer this question!