PDA

View Full Version : Problem with Ext.Window and ToolBar.. I think :S



ehuertasf
22 Aug 2009, 11:18 PM
Hello,
This is my first post and I hope you can help me, I'm trying to manage some windows with a Toolbar, what I want to do is to open a window and if it is already opened just focus on that window but when I change from one window to another using the toolbar the close button dissapears from the windows and I can't move them..:-? here is my code and Thanks.

Using WindowsXP SP2 and IE8



Ext.onReady(function(){
Ext.QuickTips.init();
new Ext.Toolbar({
renderTo: document.body,
items: [{
xtype: 'tbbutton',
cls: 'x-btn-text-icon',
icon: 'img/menu-show.gif',
text: 'Nuevo',
menu: [{
text: 'Solicitud'
},{
text: 'Persona',
handler: formPersona
},{
text: 'Cliente',
handler: formCliente
},
'-'
,{
text: 'Salir'
}]
},{
xtype: 'tbbutton',
cls: 'x-btn-text-icon',
icon: 'img/preview.png',
text: 'Consultas',
menu: [{
text: 'Solicitudes'
},{
text: 'Personas'
},{
text: 'Clientes'
}]
},{
xtype: 'tbbutton',
cls: 'x-btn-text-icon',
icon: 'img/list-items.gif',
text: 'Mantenimientos',
menu: [{
text: 'Clientes'
},{
text: 'Catalogos'
}]
},{
xtype:'tbfill'
},{
xtype:'tbbutton',
cls: 'x-btn-text-icon',
icon: 'img/delete.gif',
text:'Salir'
}]
});
function formCliente(){
if(!fcliente){
var fcliente = new Ext.Window({
title: 'Cliente',
id: 'frm_cliente',
width: 300,
height: 300
});
fcliente.show();
}else
Ext.WindowMgr.bringToFront('frm_cliente');
}
function formPersona(){
if(!fpersona){
var fpersona = new Ext.Window({
title: 'Persona',
id: 'frm_persona',
width: 300,
height: 300
});
fpersona.show();
}else
Ext.WindowMgr.bringToFront('frm_persona');
}
});

Animal
22 Aug 2009, 11:22 PM
This is a Javascript problem, not Ext.

In fact it's just programming.

Declaring a variable inside a function does what in your experience?

What value is that variable on re-entry into that function next time?