[英]How do I nest my custom search component inside my home panel?
嗨,我想知道我如何获得:
Ext.define("GS.view.search", {
extend : 'Ext.form.Panel',
xtype : 'fieldsetform',
requires : [ 'Ext.form.FieldSet' ],
config : {
width : 350,
pack : 'start',
align : 'start',
items : [ {
xtype : 'fieldset',
items : [ {
xtype : 'searchfield',
name : 'query',
placeHolder : 'Beneficios, premios o lugares',
border : 1
}, {
xtype : 'searchfield',
name : 'query',
placeHolder : 'Beneficios, premios o lugares',
border : 1
} ]
} ]
}
});
以下面板的内部(Ext.create,不起作用):
var search = Ext.create("GS.view.search");
Ext.define("GS.view.Home", {
extend : 'Ext.Panel',
xtype : "panelhome",
fullscreen : true,
layout : 'vbox',
requires : ['GS.view.search'],
config : {
title : 'Home',
iconCls : 'home',
cls : 'home',
scrollable : true,
stylehtmlContent : true,
contentEl:'searchid',
items : [{
xtype : 'panel',
width : '100%',
flex : 1,
style : 'background-color: #FFFFF',
layout : 'hbox',
items : [search]
}]
}
});
非常感谢您提供的任何帮助。
太好了!
Ext.define("GS.view.search", {
extend : 'Ext.Panel',
id : 'searchid',
alias: "widget.search",
requires : [ 'Ext.form.FieldSet' ],
config : {
width : 350,
pack : 'start',
align : 'start',
items : [ {
xtype : 'fieldset',
items : [ {
xtype : 'searchfield',
name : 'query',
placeHolder : 'Beneficios, premios o lugares',
border : 1
}, {
xtype : 'searchfield',
name : 'query',
placeHolder : 'Beneficios, premios o lugares',
border : 1
} ]
} ]
}
});
var search = new Ext.create('GS.view.search');
Ext.define("GS.view.Home", {
extend : 'Ext.form.Panel',
xtype : "panelhome",
fullscreen : true,
layout : 'vbox',
requires : ['GS.view.search'],
config : {
title : 'Home',
iconCls : 'home',
cls : 'home',
scrollable : true,
stylehtmlContent : true,
items : [{
xtype : 'panel',
width : '100%',
flex : 1,
style : 'background-color: #FFFFF',
layout : 'hbox',
items : [search]
}]
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.