Results 1 to 2 of 2

Thread: <a> anchor tag in sencha touch 2

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    21
    Vote Rating
    0
      0  

    Default <a> anchor tag in sencha touch 2

    Why is anchor <a> tag not working in sencha touch 2, in sencha touch 1 it used to work?

    What should i use instead of anchor <a> tag to call a function?

    <a href="javascript://" onclick="sendEmail()"><img src="resources/images/send.gif"></a>

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      1  

    Default

    You really shouldn't use onclick, it's a nasty way to do that in Sencha Touch. You should use event listeners.

    Code:
    component.element.on({
        scope : component,
        delegate : 'a',
        tap : function(e) {...}
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

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