1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default Unanswered: After Initialization

    Unanswered: After Initialization


    How to bind a tap event to a html element after the initiallization of the page in sencha touch 2.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Tell me about the html element. Does it have a unique class name within that component?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default


    '<span class="roundgreen" id='+x+'>'+x+'</span>'

    here x is unique id

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,649
    Answers
    3454
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Code:
    component.element.on({
         scope : component,
         delegate : 'span.roundgreen',
         tap : function(e) {}
    });
    That will fire on any tap on the span with a class of roundgreen.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default


    Hi mitchell
    Thanks for the help..one more issue is there.
    '<span class="roundgreen" id='+x+'>'+x+'</span>'

    I am storing the value of x in pnumber.
    pnumber=pnumber+x;

    Now during binding
    var subarray = pnumber.split(","); // split when a comma is encountered
    var len=subarray.length;
    var tckt_no='';
    for(i=0;i<len;i++){
    tckt_no=subarray[i];
    Ext.get(tckt_no).on({
    tap: function(){
    alert(tckt_no)
    }
    });
    }
    This is alerting a value, no matter which ever i select.

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Location
    Bangalore, India
    Posts
    139
    Answers
    2
    Vote Rating
    1
    shaleen is on a distinguished road

      0  

    Default


    I just checked the pnumber.
    Its binding the last tckt_no with all the subarray[i]

Thread Participants: 1