PDA

View Full Version : open windoe desktop fro tbar HELP



desktop
24 Feb 2009, 12:42 AM
HI

THIS WORK GOOD



MyDesktop.haaretz = Ext.extend(Ext.app.Module, {
appType : 'haaretz',
id : 'haaretz-win',

init : function(){
this.launcher = {
text: 'haaretz - ????? ',
iconCls:'haaretz',
handler : this.createWindow,
scope: this, tooltip: '<b>googel</b>'
}
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('haaretz-win');
if(!win){
MyDesktop.getDim();
win = desktop.createWindow({
id: 'haaretz-win',
title:'haaretz - ?????',
tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add',
handler : function(){
<!--the code I add--//>
if (!Ext.getCmp('myWin')){
var newWin = new Ext.Window({
id: 'myWin',
title:'hello,my friend',
width:640,
height:480,
html : '<p>Something useful would be in here.</p>',
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true

});
}
newWin.show();


}
}, '-', {
text:'Options',
tooltip:'Blah blah blah blaht',
iconCls:'option'
},'-',{
text:'Remove Something',
tooltip:'Remove the selected item',
iconCls:'remove'
}]
,
x:13,y:0,
height:590,
width:"98%",
iconCls: 'ynet',
shim:false,
animCollapse:false,
layout: 'fit',
border:false,
constrainHeader:true,
html : '<body><IFRAME SRC="http://www.haaretz.co.il" style="border:0px none;width:100%;height:100%;"></IFRAME></body>'
});
// begin: modify top toolbar
var tb = win.getTopToolbar();

// example of getting a reference to another module's launcher object
var tabWin = this.app.getModule('calc-win');

if(tabWin){
var c = tabWin.launcher;

tb.add({
// example button to open another module
text: 'Open Tab Window',
handler: c.handler,
scope: c.scope,
iconCls: c.iconCls
});
}



}

win.maximize();
win.show();
return win;
}
});

I WANT LIKE THIS BUT NOT WORKING
THIS NOT WORK WHAS THE PROBLEM?


MyDesktop.haaretz = Ext.extend(Ext.app.Module, {
appType : 'haaretz',
id : 'haaretz-win',

init : function(){
this.launcher = {
text: 'haaretz - ????? ',
iconCls:'haaretz',
handler : this.createWindow,
scope: this, tooltip: '<b>googel</b>'
}
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('haaretz-win');
if(!win){
MyDesktop.getDim();
win = desktop.createWindow({
id: 'haaretz-win',
title:'haaretz - ?????',
tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add',
handler : function(){
<!--the code I add--//>
if (!Ext.getCmp('myWin')){
var newWin = new Ext.Window({
id: 'myWin',
title:'hello,my friend',
width:640,
height:480,
html : '<p>Something useful would be in here.</p>',
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true

});
}
newWin.show();


}
}, '-', {
text:'Options',
tooltip:'Blah blah blah blaht',
iconCls:'option'
},'-',{
text:'Remove Something',
tooltip:'Remove the selected item',
iconCls:'remove'
}]
,
x:13,y:0,
height:590,
width:"98%",
iconCls: 'ynet',
shim:false,
animCollapse:false,
layout: 'fit',
border:false,
constrainHeader:true,
html : '<body><IFRAME SRC="http://www.haaretz.co.il" style="border:0px none;width:100%;height:100%;"></IFRAME></body>'
});
// begin: modify top toolbar
var tb = win.getTopToolbar();

// example of getting a reference to another module's launcher object
var tabWin = this.app.getModule('calc-win');

if(tabWin){
var c = tabWin.launcher;

var tabWin2 = this.app.getModule('acc-win');

if(tabWin2){
var c2 = tabWin2.launcher;



tb.add({
// example button to open another module
text: 'Open Tab2 Window',
handler: c.handler,
scope: c.scope,
iconCls: c.iconCls }, '-',{


text: 'Open Tab Window',
handler: c2.handler,
scope: c2.scope,
iconCls: c2.iconCls
});
}



}

win.maximize();
win.show();
return win;
}
});

desktop
24 Feb 2009, 1:20 AM
who want to help me?:-/

desktop
24 Feb 2009, 1:43 AM
i fix the problem
:))\:D/=D>


MyDesktop.haaretz = Ext.extend(Ext.app.Module, {
appType : 'haaretz',
id : 'haaretz-win',

init : function(){
this.launcher = {
text: 'haaretz - ????? ',
iconCls:'haaretz',
handler : this.createWindow,
scope: this, tooltip: '<b>googel</b>'
}
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('haaretz-win');
if(!win){
MyDesktop.getDim();
win = desktop.createWindow({
id: 'haaretz-win',
title:'haaretz - ?????',
tbar:[{
text:'Add Something',
tooltip:'Add a new row',
iconCls:'add',
handler : function(){
<!--the code I add--//>
if (!Ext.getCmp('myWin')){
var newWin = new Ext.Window({
id: 'myWin',
title:'hello,my friend',
width:640,
height:480,
html : '<p>Something useful would be in here.</p>',
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true

});
}
newWin.show();


}
}, '-', {
text:'Options',
tooltip:'Blah blah blah blaht',
iconCls:'option'
},'-',{
text:'Remove Something',
tooltip:'Remove the selected item',
iconCls:'remove'
}]
,
x:13,y:0,
height:590,
width:"98%",
iconCls: 'ynet',
shim:false,
animCollapse:false,
layout: 'fit',
border:false,
constrainHeader:true,
html : '<body><IFRAME SRC="http://www.haaretz.co.il" style="border:0px none;width:100%;height:100%;"></IFRAME></body>'
});




// begin: modify top toolbar
var tb = win.getTopToolbar();

// example of getting a reference to another module's launcher object
var tabWin = this.app.getModule('calc-win');

if(tabWin){
var c = tabWin.launcher;

tb.add({
// example button to open another module
text: 'Open Tab Window',
handler: c.handler,
scope: c.scope,
iconCls: c.iconCls
});
}

var tabWin2 = this.app.getModule( 'nrg-win');

if(tabWin2){
var c2 = tabWin2.launcher;

tb.add({
// example button to open another module
text: 'Open Ta2b Window',
handler: c2.handler,
scope: c2.scope,
iconCls: c2.iconCls
});
}

}

win.maximize();
win.show();
return win;
}
});

desktop
24 Feb 2009, 2:36 AM
demo here
http://itoto1.com/ext-4.2/examples/desktop/