facebook

Ref to item clicked activated etc. FIXED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #330042 Reply

    TNADEV
    Member

    All,
    i want to avoid hard coding refs to buttons etc in my code but cant seem to work out how to pass a pointer to the button that triggered the action…

    Current set up – button on canvas called “Test_btn” with a custom Javascript function that currently is called like so

    ItemClicked('Test_btn') 

    which supplies the instance name of the button to the ItemClicked function which is then displayed in an alert prompt.

    
    function ItemClicked(ItemRef) {    
        alert(ItemRef);    
    }
    

    Im sure this is easy but cant seem to get the right combination…..

    Anybody done this before?

    Thanks

    #330043 Reply

    TNADEV
    Member

    Ok seem to have sorted this

    
    function ItemClicked(ItemRef) {   
    var ItemPointer = ItemRef.attr("id");
       alert(ItemPointer);   
    }
    

    then change the Javascript call to

    
    ItemClicked(this)
    
    #330049 Reply

    @TNADEV,

    I’m marking this thread as fixed.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Ref to item clicked activated etc. FIXED

You must be logged in to post in the forum log in