2016-10-27 3 views
0

Ich habe ein Dropdown in meiner App mit dem SelectField-Steuerelement gezeigt. Es funktioniert gut, wenn wir auf die Pfeilschaltfläche klicken, aber wenn der Benutzer auf die Texttastatur klickt, wird sie auch geöffnet. Es ist kein Eingabefeld.Tastatur ist auf Klick auf SelectField in Sencha Touch geöffnet

enter image description here

Code:

        xtype: 'panel', 
            itemId: 'mypanel23', 
            listeners: [ 
             { 
              fn: function(component, eOpts) { 
               component.add({ 
                /***DropDown issue***/ 
                xtype: sessionStorage.voiceOver == "on"?'panel':'selectfield', 
                /***DropDown issue***/ 
                cls: 'myusage_select_list', 
                id: 'billedDD', 
                itemId: 'myselectfield', 
                hideOnMaskTap:true, 
                /***DropDown issue***/ 
                html:sessionStorage.voiceOver == "on"?"<select class='myusage_select_list' id='billedDD_Accessibility'></select>":'', 
                /***DropDown issue***/ 
                defaultPhonePickerConfig: { 
                 cancelButton: { 
                  text: BellMCare.util.config.getLocalizationValue('MobilityMyUsage_Cancel'), 
                  listeners:{ 
                   tap: function(){ 
                    var uAgent = navigator.userAgent; 
                    if(uAgent.match(/Alcatel/i)){ 
                     this.up('picker').setHidden(true); 
                    }                          
                   } 
                  } 
                 }, 
                 doneButton: { 
                  //Sanity Issue - expiry date picker not working and screen struck         
                  cls: 'pickerDoneBtn',           
                  // Sanity Issue -End 
                  text: BellMCare.util.config.getLocalizationValue('MobilityMyUsage_Done'), 
                  listeners:{ 
                   tap: function(){ 
                    BellMCare.util.config.performanceLogs('PERFORMANCE LOGS | UI | Flow 4b | start '); 

                    BellMCare.util.config.performanceLogs('PERFORMANCE LOGS | UI | Flow 4a or 4b | Changed dropdown started '); 

                    var uAgent = navigator.userAgent; 
                    if(uAgent.match(/Alcatel/i)){ 
                     this.up('picker').setHidden(true); 
                    }                          
                   } 
                  } 
                 } 

                }, 
                listeners: 
                { 
                 change: function(selectfield, newValue, oldValue, eOpts) 
                 { 
                  if(oldValue != null){ 
                   /**Dropdown Issue**/ 
                   BellMCare.app.getController("mobilityMyUsage").onBillCycleDropDownChange(); 
                   /**Dropdown Issue**/ 
                  } 
                 }, 
                 focus: function(comp){ 
                  var uAgent = navigator.userAgent; 
                  if(uAgent.match(/Alcatel/i)){ 
                   if(comp.getPhonePicker().isHidden()){ 
                    comp.getPhonePicker().setHidden(false); 
                   } 
                  }                            
                 } 
                } 
               }); 
               /**Dropdown Issue**/ 
               Ext.getCmp("billedDD").innerHtmlElement.dom.addEventListener("change", function(){ 

                BellMCare.app.getController("mobilityMyUsage").onBillCycleDropDownChange(); 

               }); 
               /**Dropdown Issue**/ 
              }, 
              event: 'initialize' 
             }, 
+0

versuchen, editierbare hinzuzufügen: false –

+0

Sie können einen Fokus Listener auf selectfield hinzufügen und das Ereignis mit * event.stopEvent() stoppen * – abeyaz

Antwort

2

Ich schaffte es durch den folgenden Code:

initialize: function(fld){ 
    var textboxEl = fld.element.query('input')[0]; 
    textboxEl.setAttribute('readonly', true); 
} 

Bitte lassen Sie mich wissen, wenn Sie irgendwelche Zweifel haben.