PDA

View Full Version : Press Enter and Add Tab Function



mjfigur
22 Jun 2011, 3:03 PM
I have a search box that when enter is pressed it will point to another function and open a tab. I am currently using firefox 5 and ext js 3.3 and when I press enter nothing happens, however if I hold down enter then 4 or more tabs are opened. Does this code look correct? Everything I have read seems like this should work:


Ext.onReady(function(){
new Ext.form.TextField({
applyTo: 'P7_SEARCH',
listeners:{
scope:this,
specialkey: function(f,e){
if(e.getKey()==e.ENTER){
$('#P7_SEARCH').htmldbSetSession({
success:function(){
fnc_search('#P7_SEARCH');
}
})
}
}
}
})
});

function fnc_search(sterm){
var tabs = Ext.getCmp('content-panel');
tabs.add({
xtype:'iframepanel',
title:'Search' + sterm,
loadMask: true,
closeable:true,
autoScroll:true
}).show();
};

mjfigur
23 Jun 2011, 2:34 PM
Just an update on this it seems to happen in both Firefox 4 and 5 when there is a PDF in an iframe. If I close the tab with the PDF the catching of entering firing from the text box works fine. Viewing pdf's in an iframe is quite an important thing for this project is there a workaround.