javascript - Adding or Replacing a new Panel to inside a Window in Ext JS -
problem has been solved already, anyways :)
i've got ext.window object. like:
var mypanel= new ext.panel({title:'placeholder'}); var cwin = new ext.window({ layout:'fit', width:screen.width-200, x:200, y:150, draggable: false, closable: false, resizable: false, plain: true, border: false, items: [mypanel] });
i'm trying replace 'mypanel' ext.panel object when user triggers specific event. figured remove mypanel , add new panel it. got removing working. adding different story, i've tried stuff in direction of:
mypanel= new ext.panel({title:'my new panel'}); cwin.add(mypanel); //dit nothing cwin.items.add(mypanel); //dit nothing cwin.insert(0,mypanel); //dit nothing cwin.items.insert(0,mypanel); //dit nothing
i'll happy answer either replacing existing panel or adding new panel.
thank you.
after adding items, should call dolayout() on container.
// remove actual contents cwin.removeall(); // add panel cwin.add( new ext.panel({title:'my new panel',width:300,height:400}) ) // repaint new contents cwin.dolayout();
should trick
Comments
Post a Comment