在V3 中, 要注意一点:
//Error, not support this definition in V3
//Ext.create("Ext.form.FormPanel", {});
这样的定义的是不可以的,会报错:
参考,http://blog.youkuaiyun.com/liuzhaolst/article/details/6685352,这篇文章提醒了我, 注意到这个错误提示信息, create() 的参数, config 是类似于JSON格式的配置信息,而文档中也说的很清楚:
所以,FormPanel 的 create() 定义格式为:
// use create() to render a formpanel, pay more attention to this style
Ext.create({
renderTo: Ext.getBody(),
title: "Form -- Create",
html: "Hello, This is [create] function"
});
还可以这样用, 同样的效果:
Ext.getBody().createChild({
tag: "h2",
html: "Simple one"
});
PS, xtype 参照表: http://blog.youkuaiyun.com/yaya203/article/details/5723749