Sunday 28 April 2013

Add Phone Number Input Text Field in Sencha Touch 2

 In Sencha Touch 2, Adding Text Field to the Form will be done by using Ext.field.Text. In my project, i suppose to add a Phone number field with input type as telephone number. I found the following code which will display telephone keyboard when you focus on the text field component.
Ext.define('MyApp.view.MyFormPanel', {

    extend: 'Ext.form.Panel',
    alias: 'widget.myformpanel',

    config: {
        items: [
            {
                xtype: 'textfield',
                component: {
                    xtype: 'input',
                    type: 'tel'
                },
                label: 'Phone Number',
                labelWidth: '45%'
            }
        ]
    }
});
Hope, you enjoyed this Post.

2 comments:

  1. I tried this and "xtype : 'numberfield'" in iPad and both the cases keypad was same so what's the change?

    ReplyDelete
    Replies
    1. Hi Floyd, This will answer this Question
      http://www.sencha.com/forum/showthread.php?181969-Phone-number-field

      Thanks

      Delete