PDA

View Full Version : popup window position.



pragan
1 Jul 2008, 1:09 PM
Hi,

I took the example of helloworld from the site and modified the code little bit to suit my need.
This is modified code:


/*
* Ext JS Library 2.1
* Copyright(c) 2006-2008, Ext JS, LLC.
* [email protected]
*
* http://extjs.com/license
*/

Ext.onReady(function(){
var win;
var button = Ext.get('show-btn');

button.on('click', function(){
// create the window on the first click and reuse on subsequent clicks
if(!win){
win = new Ext.Window({
el:'links',
layout:'fit',
width:250,
height:85,
closeAction:'hide',
modal: true,
resizable: false,
draggable: false,
plain: true,

items: new Ext.TabPanel({
el: 'all-links',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
})

/* buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]*/
});
}
win.show(this);
});
});
everything works fine but I am not able to position the pop-up window in a place I want to..right now it shows up all the way down but I wanted to show in the middle of the page or where ever I decide to.

Please help me out with the property needed to add.

Regards
pragan,

devnull
1 Jul 2008, 1:30 PM
1) you have extra uneccessary nesting; the tabPanel can be the window itself (use xtype 'tabpanel').
2) 'el' is not a valid config option here, if you want to bring in content from an existing div, use contentEl.

pragan
1 Jul 2008, 2:08 PM
Hi,
thanks for the reply..i am a newbie to this and I did not understand what you had said..please explain it..and also how about positioning the popup window?advise me

thanks
pragan

evant
1 Jul 2008, 2:34 PM
Read (http://extjs.com/deploy/dev/docs/?class=Ext.Window&member=x) the (http://extjs.com/deploy/dev/docs/?class=Ext.Window&member=y) docs (http://extjs.com/deploy/dev/docs/?class=Ext.Window&member=center).

pragan
2 Jul 2008, 9:05 AM
thanks both of you. Docs helped me in knowing more.
I added win.render(),win.center() before win.show.
Atleast its showing the popup window next to the link which I click which is good.

thanks
pragan