How To Set Diagram Builder Property

90 views Asked by At

I'm using alloy-ui Diagram Builder, I want to set Diagram Builder Property value when other Properties is set or change.

I have problem when name property is set or change other property is set for a new value but the table don't refresh. So it must click the node again for refreshing the property table.

How I can refreshing the property table?

This is my Attr Setting for setting the new value:

duration: {
             setter: function(val) {
                   var instance = this;
                   var newVal = getBrackets( this.get("name") );
                   newVal = defaultDuration[newVal];
                   if( newVal == "" || newVal == null) newVal = 0;

                   if( val == "" || newVal != val ){
                       return newVal;
                   } 
                   else{
                       return val;
                   }                                
             }
          }
1

There are 1 answers

0
stiemannkj1 On

You can listen to the durationChange event on the DiagramBuilder in order to execute code when the value of the duration attribute changes.

You can do this using the DiagramBuilder.on() Method:

diagramBuilder.on('durationChange', function(event) {
    // your code here...
});

OR the DiagramBuilder.after() Method:

diagramBuilder.after('durationChange', function(event) {
    // your code here...
});