Extjs文本输入域

   var form = Ext.create('Ext.form.Panel', {
            renderTo: Ext.getBody(),
            frame: true,
            400,
            height: 180,
            title: '多行输入',
            items: [
                { xtype: 'textarea', id: 'textArea', labelWidth: 100, fieldLabel: '多行输入', labelSeparator: ':', 300 }
            ],//labelWidth应该尽量大点,否则随着输入内容增多,文本框滚动条不断滚动,字段标签也会不自主上滚~~~宽度设置大点就不会了。
            buttons: [
                { text: '显示', handler: function show_inputText() { var meno=form.getForm().findField('textArea');alert(meno.getValue()) } }
            ]//form.getForm().findField()就相当于document.getElementById()通过组件的id或者name找到相应组件。form是pannel对象,
        });//getForm()就是返回pannel下的表单,findField()通过id和那么找到相应的表单项组件,然后利用getValue()返回表单项字段值。




        //使用了Ext。form。field。TextArea类。
原文地址:https://www.cnblogs.com/lz3018/p/4579803.html