1

I am using Extjs6.0.2 to create project , but now I have problem when I create xtype : 'namefield' cause this type of xtype support on Android and not support iOS device ,However I hope that I will find solution , How can I can xtype by using by this.

lookupReference('txtPhoneNo').setConfig('xtype','numbercode') this code replace in main.js ,

{

            xtype:'fieldset',
            items:[{

                minLength: 9,
                maxLength: 10, 
                xtype: 'textcode',
                cls: 'acledaTxt',
                itemId: 'txtPhoneNo',
                id: 'phonNo' ,
                reference: 'txtPhoneNo',

            }]

        },
Sailendra
  • 1,318
  • 14
  • 29
sreyroth
  • 13
  • 1
  • 7

1 Answers1

0

You can't change a component xtype runtime.

Instead you can, create the two components and hide or show the correct one using

if (Ext.os.is.iOS) {
    // iPad, iPod, iPhone, etc.
}

or you can create your component dinamically like this:

var xtype='';
if (Ext.os.is.iOS) {
    xtype='IOSXTYPE'
}else if(Ext.os.is.Android){
    xtype='AndroidXTYPE'
}
var component= Ext.create({
    xtype:xtype
});
LellisMoon
  • 4,810
  • 2
  • 12
  • 24
  • How about android device – sreyroth Oct 21 '16 at 09:37
  • Have a look to sencha docs, here is Ext.os.is method http://docs.sencha.com/extjs/6.0.2/modern/Ext.os.html#method-is – LellisMoon Oct 21 '16 at 09:38
  • best thank for answer but I still have problem with Android I want to use Numeric key and Input Number but I can't do, cause Keyboard in android Device still display Text Keyboard , can be input Text into Text field , cloud u have any solution for Help , I really want to Display Keyboard Number in Android Device , one more thing If I use xtype:'numberfield' How can I put 0 in first number (Ex: 010423384) ? What should I put 0 number on first number – sreyroth Oct 25 '16 at 07:51
  • var me = this, input = me.getComponent().element.down('input'); input.set({ pattern : '[0-9]*' }); me.callParent(arguments); – sreyroth Oct 25 '16 at 08:13
  • I try to apply code var me = this, input = me.getComponent().element.down('input'); input.set({ pattern : '[0-9]*' }); me.callParent(arguments); In Android device but still have problem keyborad still have text but My issue is Numeric only , – sreyroth Oct 25 '16 at 08:16
  • Best thank for support And Help now I can Find salution , – sreyroth Oct 26 '16 at 03:36