PDA

View Full Version : Panel reuse



BarryN
1 Feb 2012, 8:45 AM
I have a panel with button. One button does ajax call which creates a new panels with buttons. So far so good. Now, one of the new button should display the original panel.

// Original panel
var viewport = new Ext.Panel({
fullscreen: true, etc.,
})

// Stuff happen and new panel is display

// Now, need call to activate viewport ? NEED HELP HERE.

Thanks,
Barry

mitchellsimoens
1 Feb 2012, 9:39 AM
So basically hide and show a panel?

BarryN
1 Feb 2012, 10:30 AM
Don't need to hide because the panel is overwritten with a new panel.

But do need to show it again.


// Original panel with ajax call
var viewport = new Ext.Panel({
fullscreen: true, etc.,
})

// Ajax call successfully creates new panel with buttons
var myNewPanel = new Ext.Panel({
fullscreen: true, etc.,
})

// A button of new panel is clicked with handler. The handler's purpose is to display the original panel.

I can just recreate the entire original panel in handler and that works. But now I have the same Panel duplicated in code.