cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Click Event on JS

rgomes
7-Bedrock

Click Event on JS

Hello, friends!!

 

This is a simple (and probably a silly) question, but I'd like to create a condition if a button is clicked, without binding the click event to a function, as normally used.

 

Below, a simple example: I'd like to skip a step if the "Yes" button is clicked:

 

if(stepNumber == 1)
{
$scope.view.wdg['labelStep'].text = 'Is the light on?'

if($scope.view.wdg.['buttonYes'].click) //this is where I'm stuck at. The 'click' event is not called by the ".click" syntax, since it doesn't seem to accept it.
{
stepNumber = 3 //if the user clicks in the "Yes" button, it would skip the next step from 2 to 3.
}
}

This is probably a simple syntax error!

1 ACCEPTED SOLUTION

Accepted Solutions
rgomes
7-Bedrock
(To:rgomes)

Hello again, guys!

 

It turns out that the best method is creating a JS function on the button's click event and creating function calls inside its code so it can take condition-based actions.

 

Thanks for your time, anyway!!

View solution in original post

1 REPLY 1
rgomes
7-Bedrock
(To:rgomes)

Hello again, guys!

 

It turns out that the best method is creating a JS function on the button's click event and creating function calls inside its code so it can take condition-based actions.

 

Thanks for your time, anyway!!

Top Tags