0

The image below is a simplified version of the problem I'm facing. Both #custom and #ext-ct are hand coded. An ExtJS component is rendered to #ext-ct. Then #custom is toggled playing with its display CSS property. In IE7, showing #custom causes the component to stick to its initial position, while hiding #custom causes the component to move up.

I have tried to reproduce this bug in jsFiddle unsuccessfully. I already know the famous "hasLayout" concept, so I have tried to apply zoom:1 to #custom, then I tried this solution still unsuccessfully. Does anyone has already encountered this kind of situation? Is there a simple fix to force the component to stick to its container?

enter image description here

Community
  • 1
  • 1
  • Without seeing more of the code I can't tell if there's an option to do this any better way; however considering that you're dealing with IE7 there just might not be one. The whole purpose of Ext JS layout system is to abstract applications from the DOM, and there's huge number of ugly hacks in there that deal exclusively with IE problems. P.S. I have a personal question for you, drop me an email at nohuhu [at] nohuhu [dot] org if you don't mind. – Alex Tokarev Mar 15 '13 at 18:42

1 Answers1

1

I have found an ugly fix, I run the code below each time #custom is toggled :

if (Ext.isIE7) {
    Ext.get('custom').setStyle('zoom', 0);
    Ext.get('custom').setStyle('zoom', 1);
}

I leave this question unanswered until a better fix is found.

  • 1
    An ugly fix for an ugly browser. Honestly, you probably won't get a better solution than that. There's the repaint method, as in `Ext.get('custom').repaint()` but I've had mixed results with it. – Eric Mar 20 '13 at 12:37
  • @Eric Hi Eric. I agree with you. So you encountered the same problem? I'd like to reproduce this bug in a simpler way than it is in my js file, but it seems to be very specific. –  Mar 20 '13 at 12:59
  • Not the same problem, but something similar where a div wouldn't quite position correctly unless I poked the styles a bit. My situation was pretty specific though. – Eric Mar 20 '13 at 13:39