Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Is it possible to create bindings with js during runtime?
Solved! Go to Solution.
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'
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'