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

Bindings at runtime

SOLVED
Highlighted
Regular Member

Bindings at runtime

Is it possible to create bindings with js during runtime?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Bindings at runtime

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' 

 

 

1 REPLY 1

Re: Bindings at runtime

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'