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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Bindings at runtime

cmodin
6-Contributor

Bindings at runtime

Is it possible to create bindings with js during runtime?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cmodin ,

 

The answer is actually  No …  but in some cases also  YES.

No because we can create the structure what is behind the user interface. This means we cannot create with javaScript the binding what we can see on the bottom of GUI of studio.

But in same case is possible, because in some cases we can use a $watch javaScript /angular construct to create bindings between properties.

Example:

 $scope.$watch("view.wdg['sequence']['text']", function() {
  $scope.view.wdg['model-1']['sequence'] = $scope.view.wdg['sequence'].text;  
} );

So this will create a dynamic binding  - when the property 'text' of the  widget with the name 'sequence' will change it will set the it to the ‘sequence' property of the model widget with the name 'model-1' 

 

 

View solution in original post

1 REPLY 1

Hi @cmodin ,

 

The answer is actually  No …  but in some cases also  YES.

No because we can create the structure what is behind the user interface. This means we cannot create with javaScript the binding what we can see on the bottom of GUI of studio.

But in same case is possible, because in some cases we can use a $watch javaScript /angular construct to create bindings between properties.

Example:

 $scope.$watch("view.wdg['sequence']['text']", function() {
  $scope.view.wdg['model-1']['sequence'] = $scope.view.wdg['sequence'].text;  
} );

So this will create a dynamic binding  - when the property 'text' of the  widget with the name 'sequence' will change it will set the it to the ‘sequence' property of the model widget with the name 'model-1' 

 

 

Top Tags