PDA

View Full Version : How can i add floating component while creating viewport in ext4.1



url
15 Nov 2012, 6:20 PM
How can i add a floating window to the viewport while its getting created. When i'm trying to add with

viewport.on('add',function(){//my functionality here});it's not working..How can i add???
Any help??

suzuki1100nz
15 Nov 2012, 10:19 PM
2 options
1/. Define in the viewport items config the window
See here for adding items to viewport - http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.Viewport
(http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.Viewport)
2/.add the window to the created viewport afterwards.


var window = Ext.create('Ext.window.Window', {
title: 'My Window',
height: 200,
width: 400
});
window.show();
viewport.add(window);

url
19 Nov 2012, 2:04 AM
@Suzuki
Thanks for your response