Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/423.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript FormPanel中的ExtJS FormPanel失败,返回“0”;此.body为空";_Javascript_Extjs - Fatal编程技术网

Javascript FormPanel中的ExtJS FormPanel失败,返回“0”;此.body为空";

Javascript FormPanel中的ExtJS FormPanel失败,返回“0”;此.body为空";,javascript,extjs,Javascript,Extjs,我有一个相当复杂的设置,我已经归结为下面的代码。我有一个外部FormPanel,其中我试图包含一个组件,它是FormPanel的子类。在FF中,它会导致“this.body为null”错误 这会发生在其他人身上吗?有可能让它工作吗?如果不需要的话,我非常不想接触子类 var test = new Ext.Window({ title: 'test', items: [{ xtype: 'form', items: [{ // this is where the

我有一个相当复杂的设置,我已经归结为下面的代码。我有一个外部FormPanel,其中我试图包含一个组件,它是FormPanel的子类。在FF中,它会导致“this.body为null”错误

这会发生在其他人身上吗?有可能让它工作吗?如果不需要的话,我非常不想接触子类

var test = new Ext.Window({
  title: 'test',
  items: [{
    xtype: 'form',
    items: [{
      // this is where the subclass of FormPanel goes
      xtype: 'form',
      items: [{
        xtype: 'textfield',
        fieldLabel: 'Testing'
      }]
    }]
  }]
});
test.show();

我不确定这是否是您的确切问题,但我知道您永远不应该将xtype:“form”嵌入到xtype:“form”中。如果您需要它的布局功能,请使用xtype:“form”代替xtype:“panel”和布局:“form”。

您实际上是在尝试将一个FormPanel嵌入另一个FormPanel中。这是行不通的。我想你想要的是:

var test = new Ext.Window({
  title: 'test',
  items: [{
    xtype: 'form',
    items: [{
        xtype: 'textfield',
        fieldLabel: 'Testing'
    }]
  }]
});
test.show();

我认为,如果您在第一个“表单”中添加了一些内容(例如隐藏的文本字段),它会起作用。

Extjs不会阻止您理解HTML。您不能有嵌套表单。

一个问题的问题,但为什么不在xtype:'form'中使用xtype:'form'?我知道这对HTML来说没有多大意义,但就javascript而言,它们只是对象。当脚本被呈现到HTML中时,你基本上会有:万分感谢。刚刚因为这个问题耽误了一个多小时:(