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);