PDA

View Full Version : mix anchor offsets with fix dimensions layout



jeanluca
17 Jun 2010, 11:20 AM
Hi All

I'm reading ExtJS in Action (great book) and here is an example which doesn't seem to work as described




<html>
<head>
<title>Getting Started Example</title>
<link rel="stylesheet" type="text/css" href="lib/extjs/resources/css/ext-all.css" />

<script src="js/yui/2/build/utilities/utilities.js"></script>
<script src="lib/extjs/adapter/yui/ext-yui-adapter.js"></script>
<script src="lib/extjs/ext-all-debug.js"></script>

<script>
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'lib/extjs/resources/images/default/s.gif';
Ext.QuickTips.init();

var myWin = new Ext.Window({
height : 400,
width : 300,
layout : 'anchor',
border : false,
anchorSize : '400',
items : [
{
title : 'Panel1',
anchor: '-50, -150',
frame : true
},
{
title : 'Panel2',
height : '150',
anchor: '-10',
frame : true
}]
});
myWin.show();
});
</script>
</head>
<body>
</body>
</html>

21001
'Panel2' should be 150px in hight, but isn't. Any suggestions ?

cheers
Luca

code4jhon
26 May 2014, 8:53 AM
Hi, I'm reading it at this moment and the height of the window is supposed to be 300.
Also you are defining height as '150' change it to height:150


Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'lib/extjs/resources/images/default/s.gif';
Ext.QuickTips.init();


var myWin = new Ext.Window({
height : 300,
width : 300,
layout : 'anchor',
border : false,
anchorSize : '400',
items : [
{
title : 'Panel1',
anchor: '-50, -150',
frame : true
},
{
title : 'Panel2',
height : 150 ,
anchor: '-10',
frame : true
}]
});
myWin.show();
});

Best regards.