PDA

View Full Version : [CLOSED] add cls class to Window created in javascript ext 2.5.2



LAEUser
Feb 17, 2015, 10:22 PM
I am trying to add a cls class to a window created via javascript. Please see below, if I add a cls to window, it does not display. Can you please point me in the right direction to add a custom css to the window. Thanks




label {
font-size: .7em;
display: block;
}

.chartPopup {
font-size : 1em;
color:#111010;
padding-top: 8px;
position : absolute;
text-align : left;
vertical-align : middle;
visibility : hidden;
z-index : 9999999;
}




var config = { title: 'Additional Summary', height: popupHeight, width: 900}

var win = new Ext.Window(Ext.apply({
renderTo: Ext.getBody(),
resizable: true,
frame: true,
modal: true,
closable: true,
cls: "label chartPopup", // ==> this line causes the window to not display
closeAction: "close",
html: "HELLO",
}, config));

win.componentCls = "label chartPopup"; // ==> This does not do anything
win.show();

LAEUser
Feb 17, 2015, 10:48 PM
I found the problem with the class. Please close.
Thank you

fabricio.murta
Feb 17, 2015, 11:22 PM
Glad you could fix it so quickly! I'm sure nobody visiting this thread would mind if you shared your outcome with us. (what was wrong and how you fixed it)

LAEUser
Feb 21, 2015, 2:08 PM
Sure. This is a conversion from 1.x project to 2.5.2

The problem was my actual css. I am not sure why it worked with 1.x - see class below - The popup was loading but blank. it was hidden by the class. removing visibility: hidden and everything works.



.chartPopup {
font-size : 1em;
color:#111010;
padding-top: 8px;
position : absolute;
text-align : left;
vertical-align : middle;
visibility : hidden; ==> THI IS THE PROBLEM LINE
z-index : 9999999;
}