PDA

View Full Version : Problem whit set Dimension of panel By CSS



ProVet
22 Oct 2010, 6:47 AM
How I can set the dimension of Panel by CSS, I write a little code:
--------------------------------JscriptCode:
var p = new Ext.Panel ({
height = 300,
width = 300,
cls : ‘try’
});

-------------------------------- CSS code:
.try{
background = red;
}

I can set the Height and Width of the panel inside CSS? Because if I wrote
--------------------------------JscriptCode:
var p = new Ext.Panel ({
cls : ‘try’

});

-------------------------------- CSS code:
.try{
height = 300,
width = 300,
background = red;
}

The panel will not printed in the exact dimension.

Condor
22 Oct 2010, 6:55 AM
1. That is not valid css (e.g. height: 300px).
2. A Panel needs height and width to work with (but if you use a container for the panel you could get these values from the container).

ProVet
22 Oct 2010, 7:14 AM
and If i want use the %value of dimension of panel? I can? if yes how?

Condor
22 Oct 2010, 7:20 AM
Is this a single panel in an already existing (non-Ext) page?

In that case you should make a div with the size you want and render the panel to that div.
Next, add a FitToParent plugin to your panel.