Results 1 to 2 of 2

Thread: how to hide broswer address bar when searchfiield is touch

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default how to hide broswer address bar when searchfiield is touch

    After trying a couple of days but still can not find a way to hide the address bar when searchfield is touch. The demo site is: http://www.kdictionary.com . My code is as follows:

    Code:
    var resultPanel = new Ext.Panel({
                layout: 'fit',
                style: 'padding-bottom: 10px;'
            });
            
        
            var searchPanel = new Ext.Panel({
                dockedItems: {
                    id     :'test',
                    dock   : 'top',
                    xtype  : 'form',
                    cls    : 'x-toolbar-dark',
                    baseCls: 'x-toolbar',
                    height : 45,
                    itemId : 'newQueryForm',
                    
                    listeners: {
                        el: {
                            scope : this,
                        submit: function() {
                            var query = Ext.getCmp("newQueryField").getValue();
                            Ext.Ajax.request({
                                url: 'search.php?act=dict&q='+query,
                                success: function(e) {
                                    Ext.getCmp('carousel1').removeAll(true);
                                    ToolbarDemo.views.actioncard.tab.setBadge("");
                                    var responseTextArr = e.responseText.split('*');
                                    resultPanel.update(responseTextArr[0]);
                                    var methodcount = responseTextArr.length-1;
                                    if(methodcount > 0){
                                       ToolbarDemo.views.actioncard.tab.setBadge(methodcount);
                                       for(i=1;i<=methodcount;i++){
                                        Ext.getCmp('carousel1').add({html: responseTextArr[i]});
    
                                       }
                                       var w =  Ext.getCmp('carousel1').getWidth();
                                                                       var h =  Ext.getCmp('carousel1').getHeight();
                                                                       Ext.getCmp('carousel1').doComponentLayout(w,h);
                                                                       //Ext.getCmp('carousel1').doLayout();
        
                                    }
            
                                }
                            });
                        }
                    }
                    },
                    
                    items: {
                        xtype : 'searchfield',
                        name  : 'query',
                        id: 'newQueryField',
                        placeHolder: 'Search...'
                        
                    }
                }
            });
    
    
    ToolbarDemo.views.Searchcard = Ext.extend(Ext.Panel, {
        title: "Search",
        iconCls: "search",
        scroll: 'vertical',
        styleHtmlContent: true,
        initComponent: function() {
            Ext.apply(this, {            
                dockedItems: [searchPanel],
                items: [resultPanel]            
                
            });
            
            ToolbarDemo.views.Searchcard.superclass.initComponent.apply(this, arguments);
        }
        
    });
    
    Ext.reg('searchcard', ToolbarDemo.views.Searchcard);
    Last edited by du0012; 11 Apr 2012 at 3:28 PM. Reason: added [CODE] tags

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,411
    Vote Rating
    1290
      0  

    Default

    The address bar doesn't hide automatically for you? In ST1 it has in my apps.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •