PDA

View Full Version : autoRef does not work...



mihaip007
19 Jul 2010, 11:26 AM
Hi...!

I don't know if I am doing something wrong or maybe something is broken!
I have a toolbar. In the toolbar I have a button with a menu. In that menu there is a menu item. I want to do an operation when I click it. So I give it an autoRef name.

Then I export the project
inside my project file ".js" I do the following:


MyViewport = Ext.extend(MyViewportUi, {
initComponent: function() {
MyViewport.superclass.initComponent.call(this);
this.HelpAbout.on('click',this.HelpAboutClick, this);
}
,'HelpAboutClick': function(){
alert('here');
}
});

But the firebug tells me that "this.HelpAbout is undefined"...!
I checked inside the ui.js file and I see the following code exported by the designer:


{
xtype: 'menuitem',
text: 'About',
iconCls: 'About',
ref: '../../../../HelpAbout'
}


What am I missing?
Thanks in advance...
Mihai

jarrednicholls
19 Jul 2010, 11:58 AM
Hi Mihai,

There is a thread on this topic already. It is a bug in Ext JS. I posted a patch to Ext JS to fix the issue until it is resolved in an Ext JS release.

http://www.sencha.com/forum/showthread.php?99895-MenuItem-autoRef&p=470296#post470296

mihaip007
19 Jul 2010, 8:52 PM
hahaha! Bloody hell!
I thought something was up hehehe! The sad part is that I did read about it a few weeks ago...! hmmm!

Thank you so much - it worked like a charm!
Mihai