简体   繁体   English

使用ExtJs拆分文本框

[英]Split Text Box using ExtJs

I want to create a text box for a single label in split manner using ExtJS. 我想使用ExtJS以拆分方式为单个标签创建文本框。 Actually my requirement is a label for a telephone number, which needs a text box splitted into 3 boxes separated by "-" (hyphen). 实际上,我的要求是电话号码的标签,它需要一个文本框,该文本框分为3个由“-”(连字符)分隔的框。 It should be as follows. 应该如下。

Telephone Number: 770-268-3320 电话号码:770-268-3320

consider each bracket as a text box. 将每个括号视为一个文本框。 Hope you understood what my requirement is... Thanks in advance 希望您理解我的要求是...预先感谢

Ext.onReady(function(){
    Ext.create('Ext.form.Panel', {
        //title: 'Simple Form',
        bodyPadding: 5,
        width: 400,
        // The form will submit an AJAX request to this URL when submitted
        url: 'save-form.php',
        // Fields will be arranged vertically, stretched to full width
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },    
        // The fields
        defaultType: 'textfield',
        items: [{
            fieldLabel: 'PhoneNumber',
            name: 'phoneNumber',
            allowBlank: false
        },{
            fieldLabel: 'CustomerName',
            name: 'custCLLI',
            allowBlank: false
        }],

        // Reset and Submit buttons

        renderTo: Ext.getBody()
    });
});

Or you can check here: http://jsfiddle.net/jA8Qy/5/ 或者您可以在这里查看: http : //jsfiddle.net/jA8Qy/5/

See this . 看到这个

Hope this addresses your requirement. 希望这能满足您的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM