My diagram model contains lots of nodes. And each node can have different properties.
All nodes information is fetched from server. The properties information is not going to be used for display purpose in the diagram.
But when the diagram node is selected, I would like to send the call to server to fetch properties and display those properties using inspector.
I can use two inspector - first display the primary information of selected node in diagram and second the information fetched from server.
How I can achieve same to display external properties using inspector. And whenever those properties are changed, make a call to server to update the respective property information ?
You don’t have to use two separate Inspectors – you could combine the separate data loaded for each node onto the same Node.data object. But if you want to keep them separate for presentational clarity, that’s OK too. Or even split them up to be shown in even more Inspectors, if you have a lot of properties.
If you look at the implementation at Page Not Found -- Northwoods Software, you’ll see that each time the user modifies a value there is a transaction. So you can detect any changes to the property values by registering a Model Changed listener. Either call Model.addChangedListener or declare “ModelChanged” as a property when initializing a Diagram using GraphObject.make. In both cases you’ll want to check for ChangedEvent.isTransactionFinished and then you’ll want to look at the ChangedEvent.object, which will be a Transaction. Scan the ChangedEvents that are in the Transaction.changes list to find the property changes that you care about.