对extjs 4.2很新。为我的项目做一个POC。
Just stuck at a point where am trying to add few more items to the tabs.
Please find the code below.
In tab1 I want add a textfield.
But its not allowing and throwing a syntax error.
#######
Ext.onReady(function () {
var textName={xtype:"textfield",fieldLabel:"username",margin:"10 10"};
var tabObj=Ext.create("Ext.tab.Panel",{
title: "Registration Form",
margin:"10 10 10 40",
plain:"false",
tabPosition:"bottom",
items : [
{
title:"home",
html:"This is from Home Tab",
// xtype:"textfield",fieldLabel:"username",margin:"10 10"}
//textName
},
{
title:"services"
},
{
title:"stock"
}
],
renderTo:Ext.getBody()
});
});
#######
在docs中得不到多少帮助。 在文档中,示例仅显示添加更多带有html属性的选项卡,而不是向选项卡添加更多组件。 请帮助我。
答案 0 :(得分:0)
也许你错过了items
。
例如:
Ext.onReady(function() {
var textName = {
xtype: "textfield",
fieldLabel: "username",
margin: "10 10"
};
var tabObj = Ext.create("Ext.tab.Panel", {
title: "Registration Form",
margin: "10 10 10 40",
plain: "false",
tabPosition: "bottom",
items: [{
title: "home",
items: [
textName
]
}, {
title: "services"
}, {
title: "stock"
}],
renderTo: Ext.getBody()
});
});