You found a bug! We've classified it as EXTJS-9155 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    14
    Vote Rating
    0
    greatranil is on a distinguished road

      0  

    Default Sprite draggbel not working

    With the version 4.2 sprite can not be set as draggble,
    see the code below.

    Code:
    Ext.create('Ext.draw.Component', {
        renderTo: Ext.getBody(),
        width: 200,
        height: 200,
        items: [{
            type: 'circle',
            radius: 90,
            draggable:true,
            x: 100,
            y: 100,
            fill: 'blue'
        }]
    });
    This was work fine before 4.2.
    Any idea?

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,569
    Vote Rating
    56
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User
    Join Date
    Jan 2010
    Location
    Northern Ireland
    Posts
    59
    Vote Rating
    2
    Frith is on a distinguished road

      0  

    Default Related issue - draggable: false and sprite.el.on

    See the following code:

    PHP Code:
    sp surface.add({            
        
    type'path',            
        
    path'm 56,56 150,0 75,-75 -75,-75 -150,0 z',            
        
    fill'#F44',            
        
    draggablefalse        
    });                                

    sp.el.on('contextmenu', function(eteOpts){            
        
    e.stopEvent();            
        
    mnu Ext.create('Ext.menu.Menu', {
                                
    width100,
                                
    margin'0 0 10 0',
                                
    floatingtrue,  
                                
    items: [{
                                    
    text'regular item 1'
                                
    },{ 
                                   
    text'regular item 2'
                                
    },{
                                    
    text'regular item 3'
                                
    }]
                            });
                            
    mnu.showAt(e.browserEvent.clientX,e.browserEvent.clientY);
            }); 
    As per the previous post, when setting draggable to true, the sprite is draggable in 4.1 but not 4.2.

    In addition, if you set draggable = false in 4.1, the listener for contextmenu fails with 'Cannot call method on of undefined' whereas draggable = true allows you to capture the contextmenu event as desired.

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    24
    Vote Rating
    4
    hlurger is on a distinguished road

      0  

    Default

    Workarounds??

    It is still the same in ext js 5 (package: ext-charts)

  5. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    11
    Vote Rating
    0
    Gareth Smith is on a distinguished road

      0  

    Default

    This issue is also affecting me (in 4.2)

  6. #6
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    258
    Vote Rating
    73
    Misiu is just really nice Misiu is just really nice Misiu is just really nice Misiu is just really nice

      0  

    Default

    what about sencha-charts?
    any workaround?

  7. #7
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    12
    Vote Rating
    0
    djohnanderson is on a distinguished road

      0  

    Default Workaround

    Try to add this somewhere in your initialization code:

    Code:
    // EXTJS-9155 bug causes sprites to not be draggable because the addCls code
    // that adds the draggable class to the sprite assumes classes are strings and uses
    // it's replace method. So we'll define a nop replace method.
    if (window.SVGAnimateElement)
        SVGAnimatedString.prototype.replace = function(){return this;};