What is EXT JS's method to use "display:none"

macha picture macha · Mar 23, 2011 · Viewed 13.1k times · Source

Hello I have to load an ajax element into div. That div would earlier have another sub div by the name div1, and to remove/hide the div1, I am doing a Ext.get('div1').hide(). But this is doing a visibility:hidden, rather than doing a display:none.

I wanted to know what is the method to do a display:none rather than a visibility:hidden.

Answer

Robby Pond picture Robby Pond · Mar 23, 2011

You have to change the visibility mode to display.

var element = Ext.get('div1');
element.setVisibilityMode(Ext.Element.DISPLAY);
element.hide();