PDA

View Full Version : Draggable Sprite



Tomasz Rutyna
25 Aug 2013, 10:14 AM
Hi, I have a problem, so in my app I use draw component, and for me it is important to be able drag&drop elements in sufrace. Before I upgrade my Extjs from 4.0.7 to 4.2.1 everything work fine. In Extjs 4.2.1 I have a problem (log from Chrome console):

Uncaught TypeError: Object #<SVGAnimatedString> has no method 'replace'

I will give You a simple example, which made the same error as my, but it's easier to understand.

This error is showed when I click on element and try to move.

I can't come back to 4.0.7 because I need SVGExporter.

Example is from Sencha forum, I don't remember the author, hope He/She will forgive me:)


Ext.onReady(function() {

var drawComponent = Ext.create('Ext.draw.Component', {
viewBox : false,
width : 600,
height : 500,
items : [{
type : "path",
path : "M 438.39286,164.92857 400.35714,151 l -51.25,35.89286 40.17858,14.46428 49.10714,-36.42857 z",
fill : '#FF02D9',
'fill-opacity' : "1",
'opacity' : "0.6585366",
'fill-rule' : 'nonzero',
group : 'convc',
stroke : 'none'
}]
});

Ext.create('Ext.window.Window', {
width : 920,
height : 620,
layout : 'fit',
alias : 'widget.fenetre',
items : [drawComponent]
}).show();

drawComponent.surface.add({
type : 'circle',
fill : '#ffc',
radius : 100,
x : 100,
y : 100,
draggable: true,
}).show(true);

});

I'm new with ExtJS, so I hope it's a simple to resolve. ExtJS Masters, please help me.

Tomasz Rutyna
26 Aug 2013, 6:47 AM
Resolved.

After downgrade to 4.1.1 everything works fine.

Gary Schlosberg
27 Aug 2013, 2:46 PM
Yes, I believe that this is an existing issue:
http://www.sencha.com/forum/showthread.php?258845