如何在表单处理程序之外的sencha touch中获取表单的值

How to get values of form in sencha touch outside the form handler?

本文关键字:表单 sencha touch 获取 处理 程序      更新时间:2023-09-26

我有窗体内部面板。如何使用getValues()现在获得表单的值??

var myForm = new Ext.form.Panel({
  id:'form1',
  items:[
    { fields ...}
  ]
});
var panel = new Ext.Panel({
  id:'myPanel',
  layout:'vbox',
  items:[
    myForm,
   {
     other fields
   },
   {
    xtype : 'button',
    text : 'save',
    handler : function() {
    }
   }
  ]
});
现在

myForm.getValues();//not working
Ext.getCmp('form1').getValues();//not working 

如何获取表单外的表单值。任何帮助吗?

你需要把new放在Ext.form.Panel之前。

在SO

中发布问题之前仔细检查代码
var myForm = new Ext.form.Panel({
  id:'form1',
  items:[
    { fields ...}
  ]
});