PDA

View Full Version : Extra Toolbar Buttons Menu, How ??



chalu
27 Apr 2008, 9:04 PM
Hello community, I have run into the need to make a menu bar for 'extra' buttons in a toolbar. This technically is not an issue, but I would love to let some dynamically calculated parameter determine the 'last' toolbar button and then make the rest into a menu button for the toolbar.

Lets say, based on the rights of the user viewing the records in a grid, we want to provide certain 'record tools' for that user (create / delete / edit / archive whatever) which are made into buttons on the tbar for the grid. Say, we also always have a search combo on the far right of the tbar for all users and want to prevent the 'record tools' buttons from collapsing into the search combo, and maintain a certain distance offset from the search combo in a case where the buttons are so much and the tbar width (based on screen resolution, screen width {14' 15.4'}, viewport width or whatever system dimension we cannot control) has no more space.

Is there a way to say 'when tbar has no more space or the space before the search combo is less than 200px' make a menu of the remainder buttons if any ??????.

Animal
27 Apr 2008, 11:39 PM
Is there a way to say 'when tbar has no more space or the space before the search combo is less than 200px' make a menu of the remainder buttons if any ??????.

I see what you mean. But what you just posted there is quite a specific, and complex requirement, so there's nothing like that built into Ext.

You will have to implement stuff like this yourself.

If you upgrade to Premium Membership and get the latest code from SVN, you will see that in the next release, Ext.Toolbar is a Container which uses a Layout to arrange its child elements.

You could write your own custom Layout class which arranges Buttons in a specific way, "merging" the remaining Buttons into a split button with a Menu attached if it runs out of space.

chalu
29 Apr 2008, 5:55 PM
Thanks for the insight.



If you upgrade to Premium Membership and get the latest code from SVN


How do I upgrade please ?

Animal
30 Apr 2008, 1:41 AM
I think you'd go here: http://extjs.com/store/extjs/

You'd have to contact Ext to find the details, but being able to download the latest and greatest code and access bugfixes is pretty useful.