-
11 Dec 2006 3:04 PM #1
Toolbar Rendering Issues
Toolbar Rendering Issues
I was going to post this in Bugs, but since Toolbar is still kind of 'first pass' functionality, I figured it could go here for further discussion, and serve as ref to anyone who might come across this issue.
There's a problem with toolbar styling in FF (looks OK in IE). On mouseover, the highlight does not always match the size of the toolbar item. In the following example when you mouseover 'Add', it's hilighted correctly. When you mouseover 'Delete' the hilight is only partly over the text.
This is b/c of the width:16px in .ytoolbar .ytb-button-inner, which is applied regardless of whether there's a background image or not (IE seems to ignore the width).
Looking at the generated HTML, I see this.
I haven't dug deeper yet to see if 'undefined' is just a result of not specifying an image in the button config. In the short term you can change to 'width:auto' to handle text-only toolbar items. Here's a sample to illustrate the problem.Code:<span class="ytb-button-inner undefined">Add</span> <span class="ytb-button-inner undefined">Delete</span>
Code:<script type="text/javascript" src="/yui/build/utilities/utilities.js"></script> <script type="text/javascript" src="/yui-ext/yui-ext.js"></script> <link rel="stylesheet" type="text/css" href="/yui-ext/resources/css/yui-ext.css" /> <link rel="stylesheet" type="text/css" href="../examples.css" /> <script type="text/javascript"> var exToolbar = { addRow: function() { alert('add'); }, deleteRow: function() { alert('delete'); }, init: function() { var tb = new YAHOO.ext.Toolbar('exToolbar'); tb.addButton({ text: 'Add', click: this.addRow }); tb.addSeparator(); tb.addButton({ text: 'Delete', click: this.deleteRow }); } } YAHOO.ext.EventManager.onDocumentReady(exToolbar.init, exToolbar, true); </script> </head> <body> <h1>Toolbar Example</h1> <div class="ygrid-mso" style="width:530px;"> <div id="exToolbar"></div> </div> </body>Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
11 Dec 2006 7:31 PM #2
All toolbar buttons must have a class, and I would guess you haven't provided a class (hence the "undefined"). Toolbar buttons are by default icon only (16x16) like a standard toolbar. They have been setup with all the css properties so all they need is the background-image css property. If you are setting up a standard toolbar with icons, this is very convenient.
To create a button with text and icon (or just text) you have to provide a class with the appropriate css. I've added two classes in toolbar.css in svn for you. One is .ytb-text-icon and the other is .ytb-text-only. In your case you would use ytb-text-only as your class name and it will fix the issue.
-
12 Dec 2006 12:03 PM #3
Cool thanks.
It's not really documented, but you can pass 'disabled:true/false' in the config. Can you add a line in init() to do
that way the effects will match if you call disable() or set it via configCode:this.setDisabled(this.disabled);
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
Similar Threads
-
ToolBar issues
By rodiniz in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 8 Mar 2007, 5:01 AM -
Minor grid paging toolbar issues
By tryanDLS in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 5 Mar 2007, 9:01 AM -
Rev 8: Toolbar issues with IE7?
By js1234224 in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 22 Feb 2007, 5:28 AM -
Rendering problem in layoutdialog + toolbar + tabpanel
By seldon in forum Ext 1.x: BugsReplies: 1Last Post: 8 Jan 2007, 5:27 PM -
grid toolbar display issues in IE
By sjivan in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 4 Dec 2006, 10:16 PM


Reply With Quote