Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Translate the entire conversation x

Bindings at runtime

cmodin
8-Gravel

Bindings at runtime

Is it possible to create bindings with js during runtime?

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' 

 

 

Announcements
Top Tags