Skip to main content
1-Visitor
December 14, 2020
Question

Navigating views and showing a few different popups

  • December 14, 2020
  • 2 replies
  • 1457 views

Hi, I'm wondering if it is possible to change/navigate to a different view within the same project where after navigating to a different view, a few popups will be shown. I saw that there is already some post related to the issue I am having, however after viewing the older posts I am still unable to get the solution. Any help would be much appreciated!

2 replies

16-Pearl
December 14, 2020

Try the below, it will launch/switch to the view "demo_view1". You can define your popup in the new view:

$scope.$emit('app-fn-navigate', {'viewname': 'demo_view1'});

1-Visitor
December 15, 2020

Hi, my apologies but what I'm trying to do is to change view and show the popup both at the same time by a same button. Just double checking will that code work? As I noticed that it doesn't ask require a popup number.

16-Pearl
December 16, 2020

@CZ_9729748 

If you want to change the view from view1 to view 2 and invoke the popup when switch to view2, you can:

 

1> Navigate to view 2 in the view 1's JS:

      $scope.$emit('app-fn-navigate', {'viewname': 'view2'});

 

2> In the view 2's JS, you can use the below code to invoke the popup-1 automatically after model is loaded:

////

     $rootScope.$on('modelLoaded', function() {
         // invoke popup-1
       $scope.app.fn.triggerWidgetService('popup-1','showpopup');
} )

////

16-Pearl
January 5, 2021

Hi, @CZ_9729748 

 

You can do it with or without any code.

 

Without:

In FROM view, create a Button which Click Event Binds to TO view (navigate).

 

In TO view, create a empty 3D Model and a Popup.

Binds 3D Model Model Loaded Event to Popup Show Popup.

 

With code, please check the attachment for details.

In fact, not to much different. Same Events are used to trigger corresponding JS.