View Full Version : Tab ativate with mousedown instead with click event - how to?

11 Sep 2013, 4:55 AM
Hi dear members,

i would like to activate new Tab when i press left mouse button (mousedown) instead when i release mouse button (click).

I was digging thru the code and i saw that when you click on "Ext.tab.Bar" than "onClick" handler is called. I guess this should be overriden but i dont know how.

I searched throuh this forum and i saw that someone posted the same question a long time ago, but he didn't get an answer. So if oneone would help me i would be very gratefull.

best regards,

11 Sep 2013, 9:46 PM
Comment in the source code (http://docs.sencha.com/extjs/4.2.1/source/Bar2.html#Ext-tab-Bar-method-initComponent) says, that onClick is added by panel.Header - an ancestor of tab.Bar. You may want to look into its source too. Then override the method where onClick is added to remove that listener and bind to mousedown. If you need to call parent method from instance-level override, use this.self.{method}.apply(this,arguments).

11 Sep 2013, 11:11 PM
Thank you, thas was exactley what i needed :)