Ext.draw.sprite事件未触发

时间:2015-01-06 14:43:10

标签: java javascript extjs

我在Extjs 4.2中的图表上创建了一个精灵项目,我想捕捉精灵项目的鼠标事件。但我没有得到这些事件 有什么想法吗?

var redcircle = Ext.create('Ext.draw.Sprite', {
    type: 'circle',
    radius: 10,
    fill: '#f00',        
    x: 10,
    y: 10,
    listeners: {
        'mouseover': function (args) {
            alert('Mouse over')
        }
    },
    group: 'circles',
    surface: surface
}).show(true);

1 个答案:

答案 0 :(得分:1)

我做了一个例子,它正在我的最后工作

 Ext.onReady(function () {
      Ext.create('Ext.draw.Component', {
    renderTo: Ext.getBody(),
    width: 200,
    height: 200,
    items: [{
        type: 'circle',
        radius: 90,
        x: 100,
        y: 100,
        fill: 'blue',
        listeners:{
           mouseover:function( e, t, eOpts ){
           alert("Mouse Over");
           }
        }
    }]
});
 });
相关问题