Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7406

Set a variable after "ViewportBoundsChanged" function is called

$
0
0

@nitin291989 wrote:

Hi @walter,

In the following sample : https://gojs.net/temp/timelineInfinite.html,

I am trying to set the value of a variable after "ViewportBoundsChanged" is called.

Following are the 2 instances where i have used a variable based on which function for "ViewportBoundsChanged" is executed:

I have introduced a variable "isGoToDate" as follows:

Instance 1:

"ViewportBoundsChanged": function(e) {

  if (isGoToDate == true) {

     myDiagram.scale = e.diagram.scale;
     myDiagram.position = new go.Point(myDiagram.viewportBounds.x, e.diagram.position.y);

  }
}

Instance 2:

function initRowHeaders() {
     myDiagram.addDiagramListener("ViewportBoundsChanged", function(e) {
              // Automatically synchronize this diagram's Y position with the Y position of the main diagram, and the scale too.

        if (isGoToDate == true) {

           myRowHeaders.scale = myDiagram.scale;
           myRowHeaders.position = new go.Point(myRowHeaders.position.x, myDiagram.position.y);

        }
});

Now, after the execution of ViewportBoundsChanged's function, i want to set isGoToDate to false.

How can this be done?

Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7406