PDA

View Full Version : help:extjs window



ma_am :-)
27 Sep 2009, 10:12 PM
wt does "applyTo()" does?
n hw cn I display ma data in new window using Extjs???

Condor
27 Sep 2009, 10:30 PM
applyTo renders the component using the specified element as it's main element.

It's usually not recommended to use applyTo for Ext.Windows. Windows work better if they are rendered to the document body (which is the default, so you don't have to specify anything).

For your second question you really have to give use more information...

ma_am :-)
27 Sep 2009, 10:36 PM
here I m tryin ds code to display ma data bt it dzn work! :-(

Ext.onReady(function(){

var win;
var button = Ext.get('show-btn'); //button name

button.on('click', function(){
alert("hello.js");
// create the window on the first click and reuse on subsequent clicks
if(!win){
win = new Ext.Window({
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
/*
items: new Ext.TabPanel({
applyTo: 'hello-tabs',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
}),
*/
buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
}
win.show(this);
});
});

plzzzzzzz help me out! n leme d mistake I m doin az I m new 2 extjs.

ma_am :-)
27 Sep 2009, 10:39 PM
I m tryin ds code 2 dsplay ma data bt it dznt work! :-(

Ext.onReady(function(){

var win;
var button = Ext.get('show-btn'); // button name

button.on('click', function(){
alert("hello.js");
// create the window on the first click and reuse on subsequent clicks
if(!win){
win = new Ext.Window({
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
/*
items: new Ext.TabPanel({
applyTo: 'hello-tabs',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
}),
*/
buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
}
win.show(this);
});
});

plzzzz help me out az i m new 2 extjs n dont knw mch abt it!

ma_am :-)
27 Sep 2009, 10:41 PM
I m tryin ds code 2 display a window bt it doeznt work! :-(

Ext.onReady(function(){

var win;
var button = Ext.get('show-btn'); // button name

button.on('click', function(){
alert("hello.js");
// create the window on the first click and reuse on subsequent clicks
if(!win){
win = new Ext.Window({
layout:'fit',
width:500,
height:300,
closeAction:'hide',
plain: true,
/*
items: new Ext.TabPanel({
applyTo: 'hello-tabs',
autoTabs:true,
activeTab:0,
deferredRender:false,
border:false
}),
*/
buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}]
});
}
win.show(this);
});
});

plzzzzzzzz hlp m out az i m new 2 extjs n dont knw mch abt it!

Condor
28 Sep 2009, 12:25 AM
You can't use renderTo or applyTo inside a container!

Instead use:

el: 'hello-tabs',

ma_am :-)
28 Sep 2009, 1:11 AM
bt I hv commented thoz lines of code...i jst want to display a window (without any tab)

Condor
28 Sep 2009, 1:18 AM
I assume you meant:

win.show(button);

ma_am :-)
28 Sep 2009, 1:21 AM
ys! I m doin the same
As u cn c in ma code "win.show(this);"

bt its not working! :-(

Condor
28 Sep 2009, 1:24 AM
Define 'not working'. Are you getting a javascript error?

ma_am :-)
28 Sep 2009, 1:25 AM
no actly....i mean window is not opening bt cliking d btn.

Condor
28 Sep 2009, 1:32 AM
Do you actually have a button with id="show-btn"?

<button id="show-btn">Click me</button>

and are you including ext-base.js and ext-all.js?

ma_am :-)
28 Sep 2009, 2:08 AM
ya, i hv!