Hi guys,
first of all, thank you for a great library, I think it really fulfills all of my needs for my next project … hopefully;)
I’ve set up the Flowchart example, and would like to add groups to the JSON feed, so that I can expand/collapse groups and save those settings in a database.
I’ve added the TreeExpanderButton to the NodeTemplateMap.
The default value for Group.isSubGraphExpanded is true, so unless you set that property to false in the template, or unless you set the expanded property to false on the data, it will be expanded.
By the way, It’s hard to tell with the non-indentation, but I think your Table Panel is unnecessary, unless there is additional stuff that you elided when posting the template here.
Hi Walter,
I think you are right, the table panel is unnecessary:)
So does this mean, that I manually have to add a property to the json output, where I define if the group is expanded or collapsed? … or is there a way to automate this process?
My only problem is, that I’m creating the diagrams from scratch (and then saves them i a database), which means, that I’m not defining any groups. I can’t se that I’m able to create groups the same way that I just drag & drop the nodes on the stage. Does this mean, that I can’t update the json with the expand/collapse state?
You can add a group to your Palette the same way you added nodes.
You can also creat groups from scratch with the built in keyboard shortcut, see: Basic GoJS Sample
Specifically:
myDiagram =
$(go.Diagram, "myDiagramDiv", // create a Diagram for the DIV HTML element
{
...
// allow Ctrl-G to call groupSelection()
"commandHandler.archetypeGroupData": { text: "Group", isGroup: true, color: "blue" },
...
});