PDA

View Full Version : a problem with SplitBar



within0713
16 Jul 2009, 1:09 AM
Thank you for reading
I have a problem with EXT.
Here is my code. The error which comes chrome developer is "Cannot read property 'dom' of null".

Please help!!!!

<body class=" yui-skin-sam" >
<script type="text/javascript">
(function () {
var YSB = Ext.SplitBar;
var split = new YSB('resizer', 'left_space', null, YSB.LEFT);
split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter("container"));
split.minSize = 100;
split.maxSize = 600;
split.animate = true;
split.on('moved', splitterMoved);
var YSB = Ext.SplitBar;
var split = new YSB('resizer', 'left_space', null, YSB.LEFT);
}());
</script>
<?php echo "this is within"?>
</body>

steffenk
16 Jul 2009, 1:57 AM
1) please use code boxes for code
2) i don't see the dom elements "elementToDrag", "elementToSize"
3) read the docs http://extjs.com/deploy/dev/docs/?class=Ext.SplitBar

within0713
19 Jul 2009, 6:45 PM
Now my code is




(function () {
var canvasPanel = new Ext.Panel({
id:'canvas-panel',
title:'Canvas',
region:'center',
height:500,
border:true,
contentEl: 'canvas2'
});
var templatePanel = new Ext.Panel({
id:'template-panel',
region:'west',
title:'template',
width: 200,
border: true,
contentEl: 'canvas'
});
var split = new Ext.SplitBar('container','container1',
Ext.SplitBar.HORIZONTAL,Ext.SplitBar.LEFT);
split.setAdapter(new Ext.SplitBar.AbsoluteLayoutAdapter('pluginHolder'));
split.maxSize = 600;
split.animate = false;
split.on('moved', splitterMoved);
}());

Condor
19 Jul 2009, 9:46 PM
You need to move your code inside Ext.onReady, otherwise the DOM won't be available.