var form = Ext.create('Ext.form.Panel', {
            renderTo: Ext.getBody(),
            frame: true,
            width: 400,
            height: 180,
            title: '多行输入',
            items: [
                { xtype: 'textarea', id: 'textArea', labelWidth: 100, fieldLabel: '多行输入', labelSeparator: ':', width: 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类。

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-02-18
  • 2021-07-08
  • 2022-12-23
猜你喜欢
  • 2021-07-04
  • 2021-11-11
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案