PDA

View Full Version : [CLOSED] [4.2.x] Sprite.initDraggable throws an error when sprite is added to surface.



vadimv
18 Nov 2013, 1:12 AM
Ext version tested

4.2.2
4.2.1
Description
When trying a sprite with draggable: true, initDraggable throws an error because of missing reference/value of the surface element

Steps to reproduce the problem

https://fiddle.sencha.com/#fiddle/1kg



Ext.create('Ext.draw.Component', {
renderTo: Ext.getBody(),
width: 200,
height: 200,
items: [{
draggable: true,
type:'circle',
radius:90,
x:100,
y:100,
fill:'blue'
}]
});


Result that occurs

Uncaught TypeError: Cannot read property 'dom' of undefined ext-all-dev.js:119410 (http://charts/ext-all-dev.js)

Ext.define.applyZIndexext-all-dev.js:119410 (http://charts/ext-all-dev.js)
Ext.define.createSpriteElementext-all-dev.js:118941 (http://charts/ext-all-dev.js)
Ext.define.initDraggableext-all-dev.js:118191 (http://charts/ext-all-dev.js)
Ext.define.onAddext-all-dev.js:84339 (http://charts/ext-all-dev.js)
Ext.define.addext-all-dev.js:84276 (http://charts/ext-all-dev.js)
Ext.define.addext-all-dev.js:84268 (http://charts/ext-all-dev.js)
Ext.define.initItemsext-all-dev.js:84068 (http://charts/ext-all-dev.js)
Ext.define.constructorext-all-dev.js:83976 (http://charts/ext-all-dev.js)
constructorext-all-dev.js:8181 (http://charts/ext-all-dev.js)
(anonymous function)
Ext.ClassManager.instantiateext-all-dev.js:8931 (http://charts/ext-all-dev.js)
(anonymous function)ext-all-dev.js:3392 (http://charts/ext-all-dev.js)
Ext.define.statics.createext-all-dev.js:83794 (http://charts/ext-all-dev.js)
Ext.define.createSurfaceext-all-dev.js:85134 (http://charts/ext-all-dev.js)
Ext.define.onRender

LesJ
18 Nov 2013, 7:18 AM
Looks like a bug, although 'ill' should probably be 'fill' ;)

vadimv
18 Nov 2013, 7:20 AM
Looks like a bug, although 'ill' should probably be 'fill' ;)

:) thx…that's because of the code formatter + copy&paste

Gary Schlosberg
18 Nov 2013, 9:45 AM
Thanks for the report! I have opened a bug in our bug tracker.