PDA

View Full Version : Click Options to run function



manuito
23 Feb 2010, 4:22 AM
I want to execute the alert function to click a option menu ("Configurar"), but dont work.


var viewport = new Ext.Viewport({
layout:'fit',
items:[{
xtype: 'grouptabpanel',
tabWidth: 160,
activeGroup: 0,
items: [{
mainItem: 0,
items: [optEncender,optConfigurar]
},{
...................

var optConfigurar={
id:'config',
xtype: 'portal',
title: 'Configurar',
iconCls: 'x-icon-configuration',
tabTip: 'Configurar el Aula',
style: 'padding: 10px; ',
items:[],
handler:function(){ alert("hello"); },
};

Can someone help??
Thanks!

manuito
24 Feb 2010, 12:04 AM
I solved the problem:


var optConfigurar={
id:'config',
xtype: 'portal',
title: 'Configurar Aula',
iconCls: 'x-icon-configuration',
tabTip: 'Configurar el Aula',
style: 'padding: 10px; ',
items:[],
listeners:{
beforeShow:function(){alert("hola")}
},
};

Thanks!