ExtJS: adding an item to an existent window
- by farhad
Hello! How can i add an item to an existent window? I tried win.add() but it does not seem to work. Why? This is my piece of code:
function combo_service(winTitle,desc,input_param) {
/* parametri */
param=input_param.split(","); /* della forma: param[0]="doc1:text", quindi da splittare di nuovo */
/* cosi' non la creo più volte */
win;
if (!win)
var win = new Ext.Window({
//title:Ext.get('page-title').dom.innerHTML
renderTo:Ext.getBody()
,iconCls:'icon-bulb'
,width:420
,height:240
,title:winTitle
,border:false
,layout:'fit'
,items:[{
// form as the only item in window
xtype:'form'
,labelWidth:60
,html:desc
,frame:true
,items:[{
// textfield
fieldLabel:desc
,xtype:'textfield'
,anchor:'-18'
}]
}]
});
win.add({
// form as the only item in window
xtype:'form'
,labelWidth:60
,html:desc
,frame:true
,items:[{
// textfield
fieldLabel:desc
,xtype:'textfield'
,anchor:'-18'
}]});
win.show();
};
What's wrong with my code? Thank you very much.