Results 1 to 4 of 4

Thread: How to add event to Ext.draw.sprite.Image

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    9
    Vote Rating
    0
      0  

    Default How to add event to Ext.draw.sprite.Image

    Hi all,

    How can I add click event to Ext.draw.sprite.Image. My code as below,
    Code:
    var drawContainer = Ext.create('Ext.draw.Container', {
         height: 1500,
         width: 800
     });
    
    var flowButton = new Ext.draw.sprite.Image({ type: "image", src: "../images/open.png", x: 30, y: 8, height: 50, width: 30, draggable: false });
    
    flowButton.addListener(
        'click', function () {
               Ext.MessageBox.alert('You Clicked');
        });
    
     drawContainer.getSurface().add(flowButton);
    I have image show up, but the click event does not be fired.

    Please advise,
    T
    Last edited by tristan.lee; 12 May 2015 at 1:11 PM. Reason: Please place code inside CODE blocks

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165
    Vote Rating
    79
      0  

    Default

    I've created an example here to show you how to add spriteclick events to the draw Container. One issue right now is that it appears to only works for Path sprites. I've went ahead and added this ticket to our bug tracking system.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Oct 2013
    Posts
    54
    Vote Rating
    0
      0  

    Default

    Hi Lee,

    Any update on the listener for image sprite.

  4. #4
    Sencha User
    Join Date
    Sep 2015
    Location
    Antwerp
    Posts
    12
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by sencha.santa View Post
    Hi Lee,

    Any update on the listener for image sprite.

    I was trying functionality of sprites with version 6.0.1 and it looks like it doesnt work yet for image sprites and composite sprites.

Similar Threads

  1. How to set image src of an Ext.draw.Sprite type image?
    By mrsunshine in forum Sencha Touch 2.x: Q&A
    Replies: 4
    Last Post: 20 Apr 2012, 5:10 AM
  2. [FIXED] [4.1 B2]Ext.draw.Sprite image x and y do not become effective
    By Kazuhiro Kotsutsumi in forum Ext:Bugs
    Replies: 4
    Last Post: 2 Feb 2012, 7:17 PM
  3. Replies: 0
    Last Post: 30 Oct 2011, 9:53 AM
  4. Using Draw ApI { xtype:'sprite', type:'image'}'
    By mgwalikar in forum Ext: Discussion
    Replies: 0
    Last Post: 29 Sep 2011, 4:51 AM
  5. draw: image tag sprite.setAttributes( src: src) not update image
    By jimmylu98 in forum Sencha Touch 1.x: Charts
    Replies: 6
    Last Post: 19 Aug 2011, 1:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •