PDA

View Full Version : Making the entire splitbutton clickable



tercerojista
24 Feb 2011, 5:45 AM
We're writing Selenium tests for our app, and testing splitbuttons has proved slightly problematic due to the lack of an ID for the down arrow part of the button that opens the menus. The proposed workaround was to just make the entire button clickable, so that clicking it would either open or close the menu.

I tried adding the following simple handler, but it fails because it seems that the default action when clicking the button is to close the menu.



handler: function() {
this.hasVisibleMenu() ? this.hideMenu() : this.showMenu();
},


Is there a way to do what I'm trying to achieve?

Condor
24 Feb 2011, 5:50 AM
In that case, why would you want a SplitButton? Use a normal Ext.Button with a menu.

tercerojista
24 Feb 2011, 6:05 AM
Seems like a very nice solution! Thanks!