PDA

View Full Version : Menu width problem in IE7 (only)



owais.zahid
3 Sep 2012, 1:32 AM
I am using extJS 3.3 and having the problem with the width of the menu on IE7 strict mode (only). The width of the menu is too small to show the complete menu items.

I try to do some experiment and found this link http://www.sencha.com/forum/showthread.php?82962-Internet-Explorer-8-width-of-menu-items-to-small and add the autoWidth method (with minor modifications) on Menu.js



autoWidth : function() {
var el = this.el;
var ul = this.ul;
if (!el) {
return;
}
var w = this.width;
if (w) {
el.setWidth(w);
} else if (Ext.isIE7) {
el.setWidth(this.minWidth);
var t = el.dom.offsetWidth; // force recalc
el.setWidth(ul.getWidth() + el.getFrameWidth("lr"));
}
}


It seems to be working in IE7 but i don't understand how? Please tell me is this the correct approach to fix this problem or if there are any other then let me know.

Thanks

scottmartin
4 Sep 2012, 6:03 AM
Have you tried upgrading to 3.4 to see if that helps?

As for the fix, this should be fine. You can always step through the code to see how it works.

Scott.

owais.zahid
5 Sep 2012, 3:42 AM
Thanks for the reply scott. The update to 3.4 is not possible right now. I tried to use break points and logging to see how this method is effecting the width setting. Strangely enough, the code is not breaking on break points and there are no logs. This suggests that this method is not being used at all. However, it seems to be doing the trick in IE7.