2013-11-24 38 views
0

我正在使用cordova 1.8和sencha touch 2.2.1.My问题是当我点击一个文本框时,它显示键盘而不是iframe。键盘显示代替iframe在sencha触摸的地方

这是我的煎茶代码:

onfocus : function(){ 

Ext.getCmp('toolid').hide(); 

Ext.getCmp('crperid').hide(); 

Ext.getCmp('eventcvideoid').hide(); 

    Ext.getCmp('sqlbacklbl').show(); 
     // Ext.getCmp('dattimepanelid').setHtml('<iframe id="dtid" src="http://example.com</iframe>'); 

     // frame.contentWindow.scrollTo(0, 1000); 
     Ext.getCmp('dattimepanelid').show(); 

回答

0

使用此代码隐藏键盘

var activeElement = document.activeElement; 

activeElement.setAttribute('readonly', 'readonly'); // Force keyboard to hide on input field. 

activeElement.setAttribute('disabled', 'true'); // Force keyboard to hide on textarea field. 

Ext.defer(function() { 

activeElement.blur(); 
     // Remove readonly attribute after keyboard is hidden. 

activeElement.removeAttribute('readonly'); 

activeElement.removeAttribute('disabled'); 

    if(callback) { 

    callback.call(scope); 

} 

}, 100);