I Have a fieldset inside a FormPanel. I am adding an element to 'fieldset' dynamically. But this element is getting added at the bottom of 'fieldset'where as I want to add this element as a first element of my 'fieldset' i.e. on the top. How can I do that? Can someone help me?
My code for 'fieldset':
var List = {
xtype :'fieldset',
id :'List',
title :List,
autoHeight :true,
items : [
{
xtype :'button',
id :'save',
text :save,
handler : function() {
......
}
},
开发者_运维问答grid ]
};
Code to add element:
Ext.getCmp('List').add(
{
html :'Error'
});
Ext.getCmp('panel').doLayout();
Thanks...
Try to use the insert(index,component)
function:
Ext.getCmp('List').add(
yourCompnent
);
Ext.getCmp('List').insert(0,yourCompnent);
Ext.getCmp('panel').doLayout();
精彩评论