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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Hide and Show widgets when switching Sequence

PhilipB
8-Gravel

Hide and Show widgets when switching Sequence

I have a model with 2 sequences. Right now I switch between the sequences via a 2D select widget. 

 

What I am trying to achieve is that if a choose one of the sequences a popup with a text will be visible and switching back to the first sequence the popup will disappear. 

I have tried different variations with no success and hope someone can help with see whats wrong. At first I have this code snippet: 

 

$scope.$on("$ionicView.afterEnter", function(event) {
$scope.app.view.Home.wdg['select-1'].value = 'l-Creo 3D - Standard View.pvi'
           });

This to set which view is selected to begin with, also this is the view that I want no visible popup. 

 

Then I have this code snippet which follows and make the function "sequencemode":

$scope.sequencemode = function(){ 
if($scope.app.view.Home.wdg['select-1'].value = 'l-Creo 3D - Standard View.pvi'){
$scope.app.view.Home.wdg['popup-1'].visible = false;
}
else{
$scope.app.view.Home.wdg['popup-1'].visible = true;
}

 

The idea is that it is a "if statement" which says that if the select widget has the value of which it starts with "standard view" the popup will be false, then if it has another value the popup will show. 

 

This function I added in at "valuechange" in the property for a sequencelist. Meaning every time you change value in the select list this function should be starting. 

 

However what happens is that if I have this code active in home.js I am not able to even change the value in the list. 

 

I wonder if someone has made something similiar? 

 

Best regards, 

Philip Bengtsson 

1 ACCEPTED SOLUTION

Accepted Solutions

Ok,

This one got solved pretty easy after some asking around. apparently if one rewrite the if statement like this:

 

if($scope.app.view.Home.wdg['select-1'].value == 'l-Creo 3D - Standard View.pvi')

Meaning that you have double equal signs "==" the if statement worked and the rest of the code aswell. 

 

This one got resolved! 

View solution in original post

1 REPLY 1

Ok,

This one got solved pretty easy after some asking around. apparently if one rewrite the if statement like this:

 

if($scope.app.view.Home.wdg['select-1'].value == 'l-Creo 3D - Standard View.pvi')

Meaning that you have double equal signs "==" the if statement worked and the rest of the code aswell. 

 

This one got resolved! 

Top Tags