PDA

View Full Version : Move a component from one panel to another



glenho
5 Sep 2013, 10:20 PM
Is it possible to move a component from one panel to another. i.e. If I have a grid in panel A can I create a modal window and move it into that window?

How would that be done?

Thanks

evant
6 Sep 2013, 12:26 AM
var p = new Ext.panel.Panel({
title: 'Move me'
});

var ct1 = new Ext.container.Container({
layout: 'fit',
width: 100,
height: 100,
renderTo: document.body,
items: p
});

var ct2 = new Ext.container.Container({
layout: 'fit',
width: 200,
height: 200,
renderTo: document.body
});

setTimeout(function() {
ct2.add(p);
}, 1000);

glenho
9 Sep 2013, 1:12 PM
Thank you.

I was playing around with panel.items.remove() and panel.items.add() which didn't work :)

Please mark as solved.