PDA

View Full Version : Why the Ext.panel.Panel can't show autoScroll when use to show the SVG str?



Fent2
16 Apr 2014, 7:34 PM
If use normal html str,that ok ,it can show the vertical scroll,but when use
the svg str, it can not show the scroll !
The code I test like below, Somebody know whether the panel can show scroll when show svg?
or their some way to config?


Ext.onReady(function() {

var svg_str = '<svg width="100%" height="100%" version="1.1"' +
'xmlns="http://www.w3.org/2000/svg">' (http://www.w3.org/2000/svg&quot;>') +

'<text id="XPos" x="50" y="50">X Position :</text>' +
'<text id="YPos" x="50" y="70">Y Position :</text>' +
'<text id="ClickPos" x="50" y="90">Last Click made at : </text>' +
'<rect x="50" y="100" width="200" height="1200" style="fill:blue" ' +
'</svg> ';


var normal_str = '<p>World!</p> <p>World!</p><p>World!</p><p>World!</p> <p>World!</p> <p>World!</p> <p>World!</p> <p>World!</p><p>World!</p><p>World!</p><p>World!</p> <p>World!</p> <p>World!</p>';


var constrainedWin, constrainedWin2,drawComponent;
var win2 = Ext.create('Ext.panel.Panel', {
height: 300,
width: 800,
//x: 450,
// y: 450,
title: 'test111',
closable: false,
plain: true,
layout: 'fit',
renderTo:Ext.getBody(),
closable:true,
html:svg_str,
resizable:true,
autoScroll:true,

});

});

mitchellsimoens
29 Apr 2014, 5:01 AM
Isn't your SVG have width and height of 100% so there won't be any scrolling.