Ext


Go Back   Ext JS Forums > Ext General Forums > Ext: Open Discussion

View Poll Results: Should the Toolbar overflow manage items other than buttons
Yes 23 95.83%
No 1 4.17%
Voters: 24. You may not vote on this poll

Reply
 
Thread Tools
  #11  
Old 08-17-2009, 02:47 PM
mystix's Avatar
mystix mystix is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: Singapore
Posts: 5,642
mystix is on a distinguished road
Default

Quote:
Originally Posted by jgarcia@tdg-i.com View Post
It's in the title.
d'oh
__________________


3.x - ( Docs | Examples | SVN Log ) / 2.x - ( Docs | Examples )
HOWTO - ( Report Bugs | Post Proper Code ) / Learn / Saki's Examples
Forum Search (FF/IE plugin) / API Search (FF/IE plugin)
Reply With Quote
  #12  
Old 08-17-2009, 02:54 PM
jgarcia@tdg-i.com's Avatar
jgarcia@tdg-i.com jgarcia@tdg-i.com is offline
Ext Support Team
 
Join Date: Mar 2007
Location: Frederick MD, NYC, DC
Posts: 11,450
jgarcia@tdg-i.com is on a distinguished road
Send a message via AIM to jgarcia@tdg-i.com Send a message via Skype™ to jgarcia@tdg-i.com
Default

thx
__________________
Get 42% off by using coupon code n2442 valid until (11/24/09) -> [Book] - Ext JS In Action

My Blog || Ext JS screencasts || ext-doc || twitter

My free extensions/plugins:
Progressbar inside paging toolbar || Tab panel scroller menu || Window drawers || Icon Manager
Grid view custom 'view' filter || PanelHeaderToolbar

JavaScript Magazine August article now available.
Reply With Quote
  #13  
Old 08-18-2009, 01:32 PM
miti miti is offline
Ext JS Premium Member
 
Join Date: Oct 2007
Posts: 44
miti is on a distinguished road
Default

The overflow feature of the toolbar is useless if it doesn't handle combo and text fields for us. How hard it is to do it?
Reply With Quote
  #14  
Old 08-19-2009, 03:35 AM
Condor's Avatar
Condor Condor is online now
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: The Netherlands
Posts: 14,296
Condor is on a distinguished road
Default

Unfortunately it's very hard.

ToolbarLayout would:
- have to make copies of all components to put them in the overflow menu (but the copies will almost certainly have problems, e.g. unique ids).
or
- carefully move components from the toolbar to the overflow menu and back again (ToolbarLayout wasn't designed for this, so this would be a lot of work).
__________________
Condor
Reply With Quote
  #15  
Old 08-19-2009, 05:25 AM
jgarcia@tdg-i.com's Avatar
jgarcia@tdg-i.com jgarcia@tdg-i.com is offline
Ext Support Team
 
Join Date: Mar 2007
Location: Frederick MD, NYC, DC
Posts: 11,450
jgarcia@tdg-i.com is on a distinguished road
Send a message via AIM to jgarcia@tdg-i.com Send a message via Skype™ to jgarcia@tdg-i.com
Default

Quote:
Originally Posted by miti View Post
The overflow feature of the toolbar is useless if it doesn't handle combo and text fields for us. How hard it is to do it?
useless? not totally!
__________________
Get 42% off by using coupon code n2442 valid until (11/24/09) -> [Book] - Ext JS In Action

My Blog || Ext JS screencasts || ext-doc || twitter

My free extensions/plugins:
Progressbar inside paging toolbar || Tab panel scroller menu || Window drawers || Icon Manager
Grid view custom 'view' filter || PanelHeaderToolbar

JavaScript Magazine August article now available.
Reply With Quote
  #16  
Old 08-19-2009, 03:25 PM
miti miti is offline
Ext JS Premium Member
 
Join Date: Oct 2007
Posts: 44
miti is on a distinguished road
Default

Sorry I didn't mean the feature is useless. It is actually a very nice addition to the toolbar. It is just for our app, there is almost always a search textfield on the far right corner of the toolbars and it cannot go to the overflow menu now.

Is there a way to config which toolbar items go to the overflow toolbar if necessary? So I can skip some of them don't fit in the dropdown?
Reply With Quote
  #17  
Old 08-21-2009, 10:59 AM
reaper.br reaper.br is offline
Ext User
 
Join Date: Sep 2007
Location: Santa Catarina - Brazil
Posts: 31
reaper.br is on a distinguished road
Default

When you have a toolbar with items other than buttons (like text and form items), the overflow menu is created with no items.
To have the old toolbar behaviour, just set the enableOverflow option to false (undocummented, see this post)

Changing jgarcia's example a bit...
new Ext.Window({
    width  : 200,
    height : 100,
    tbar   : new Ext.Toolbar({
        enableOverflow: false,
        items: [
        {
            text : 'btn 1'
        },
        {
            text : 'btn 1'
        },
        {
            xtype : "combo",
            store : []
        },
        {
            text: 'test',
            xtype: 'tbtext'
        }
    ]})

}).show()
It would be nice if the text items could be moved to the menu as well.

Cheers
Reply With Quote
  #18  
Old 10-26-2009, 02:02 PM
kveeiv kveeiv is offline
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 11
kveeiv is on a distinguished road
Default

I think the new toolbar overflow capability is awesome, as its one less thing I have to think about for users with behind-the-times resolutions. But this limitation is a deal breaker as we often have combos on the right side of paging toolbars to support different filtering/list selection options.

Based on Condor's notes above, I've created the following override of the Toolbar layout that supports overflowing any(?) component. I've only tested this with combo controls, so your mileage may vary. The following component configurations are added by this override:

enableOverflow: false to revert to current functionality (not overflowed), defaults to true
hideOnClick: true to hide the menu when the component is clicked, passed on to basemenuitem (defaults to false)

There are probably slicker ways to do some of this; comments, corrections and revisions are welcomed and appreciated.

<script type="text/javascript">
Ext.override(Ext.layout.ToolbarLayout, {
	addGenericComponentToMenu : function(m, c){
		var domPos = c.getDomPositionEl();
		m.add({
			xtype: 'menubaseitem',
			iconCls: 'no-icon',
			hideOnClick: c.hideOnClick,
			listeners: {
				'render': function(cmp) {
					c.xtbOldParent = domPos.dom.parentNode;
					cmp.getEl().insertFirst(domPos);
					if (Ext.isFunction(c.getListParent)) {
						c.xtbOldGetListParent = c.getListParent;
						c.getListParent = function() { return this.el.up('.x-menu'); };
					}
				},
				scope: this
			}
		});
		var minWidth = this.getItemWidth(c) + 44; // wasnt sizing properly for some components
		if (m.getWidth() < minWidth) {
			m.setWidth(minWidth);
		}
		m.on('hide', function() {
			Ext.get(c.xtbOldParent).appendChild(domPos);
			delete c.xtbOldParent;
			if (c.xtbOldGetListParent) {
				c.getListParent = c.xtbOldGetListParent;
				delete c.xtbOldGetListParent;
			}
		}, this, { single: true });
	},
	addComponentToMenu : function(m, c){
		if(c instanceof Ext.Toolbar.Separator){
			m.add('-');
		}else if(Ext.isFunction(c.isXType)){
			if(c.isXType('splitbutton')){
				m.add(this.createMenuConfig(c, true));
			}else if(c.isXType('button')){
				m.add(this.createMenuConfig(c, !c.menu));
			}else if(c.isXType('buttongroup')){
				c.items.each(function(item){
					this.addComponentToMenu(m, item);
				}, this);
			}else if(c.enableOverflow !== false){
				this.addGenericComponentToMenu(m, c);
			}
		}
	}
});
</script>
Reply With Quote
  #19  
Old 10-27-2009, 03:57 AM
joeri joeri is offline
Ext JS Premium Member
 
Join Date: Aug 2007
Location: Antwerp, Belgium
Posts: 172
joeri is on a distinguished road
Default

What if you could just specify a property "overflowItem" on each toolbar item, that you can attach a component to? Then it's up to the implementor to have correct overflowing, but at least it's possible. This would side-step the whole issue of how you move the toolbar items to the overflow menu without breaking them.
Reply With Quote
  #20  
Old 11-05-2009, 06:09 AM
JamesC JamesC is offline
Ext JS Premium Member
 
Join Date: Nov 2007
Posts: 206
JamesC is on a distinguished road
Default

The poll is closed (I would have voted yes), what's happening about this officially? Is there a feature request open?
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 04:05 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.