PDA

View Full Version : Passing an Action & a Config to a New Ext.Button



philmaker
6 Apr 2008, 9:51 AM
I'm a big fan of using actions mainly coming from using Swing. Passing an action to a button isn't quite documented in the Button API but it works and it's in one of the toolbar examples. However, I can't quite figure out how to pass an action and a button config in the constructor of an Ext.Button. I'm mainly just trying to add a tooltip for the button for now. Additionally, it would be cool if actions had a description property which the Ext.Button looks at and uses as the tooltip but I don't think this is built-in and guess I'd have to extend Ext.Button for this?

Is it possible to pass an action and a button config to a new Ext.Button?

Thanks,
Phil

philmaker
6 Apr 2008, 10:37 AM
I figured it out - the problem was that I was never calling Ext.QuickTips.init(); A button does indeed use the additional config options applied to an action's config. So if I set tooltip on the action config, the button does get the tooltip - very delightful!

Phil