Question about the Record Mapper sample

I am implementing GoDiagram.Net’s CollasingRecordNode using GoJS.
I refer to GoJS’s Record Mapper sample, but some of the work is not easy.

  1. After adding the PanelExpanderButton to the GOJS Record Mapper sample, change the length of the node with the mouse and click the collapse button, the field items will not be visible but the height of the node will not be changed.

  2. How do I find the llink associated with a field item in GoJS’s Record Mapper?

I’m not sure exactly how you added a “PanelExpanderButton”, but I’ll assume you did something similar to what’s in the EntityRelationship sample: Entity Relationship.

The idea is that you don’t want to lose the information that the user provided. So if they said that the node should be a certain height because they resized it that way then the app should not be discarding that information.

I suppose it would be reasonable to have a click of the “PanelExpanderButton” set the Node.resizeObject’s desiredSize to new go.Size(NaN NaN). In other words, the user’s wanting to expand or collapse a panel should take precedence over the user’s manual resizing.

What information do you have at the time you want to find out what Link(s) are connecting with a particular item?

Each port gets a portId from the itemdata.name property. So if you have a reference to the Node, you can find all of the Links connecting with a port by calling Node | GoJS API, passing the name of the item/port.

http://gojs.net/latest/intro/collections.html

In version 1.7 we’ll add this Binding to the Node template in the EntityRelationship sample:

        // whenever the PanelExpanderButton changes the visible property of the "LIST" panel,
        // clear out any desiredSize set by the ResizingTool.
        new go.Binding("desiredSize", "visible", function(v) { return new go.Size(NaN, NaN); }).ofObject("LIST"),