我在FormPanel中有一个字段集。我正在动态地向'fieldset‘添加一个元素。但是这个元素是在'fieldset‘的底部添加的,我想把这个元素作为’fieldset‘的第一个元素添加到顶部。我该怎么做呢?有人能帮我吗?
我的‘fieldset’代码:
var List = {
xtype :'fieldset',
id :'List',
title :List,
autoHeight :true,
items : [
{
xtype :'button',
id :'save',
text :save,
handler : function() {
......
}
},
grid ]
};添加元素的代码:
Ext.getCmp('List').add(
{
html :'Error'
});
Ext.getCmp('panel').doLayout(); 谢谢..。
发布于 2011-12-11 18:17:41
尝试使用insert(index,component)函数:
Ext.getCmp('List').add(
yourCompnent
);
Ext.getCmp('List').insert(0,yourCompnent);
Ext.getCmp('panel').doLayout(); https://stackoverflow.com/questions/7442679
复制相似问题