How to add Swim Lanes

I want to create a button to add more swim lanes to the GoJS swim lanes sample.

What approach should I use to add new swim lanes?

I noticed that swim lanes are added as a group on a template and that a constructor of Boolean’s values in the GOJS swim lanes sample code (excerpted from GoJS site) were turned off shown below:

myDiagram.groupTemplate =
$(go.Group, horizontal ? go.Panel.Vertical : go.Panel.Horizontal,
{ movable: false, copyable: false, deletable: false, // can’t move or copy or delete lanes

Tell me is it just a matter of reversing the Boolean values to “true” needed to turn on these functions?

Again, I want to be able to add swim lanes by clicking a “add” button; what’s the best techniqure?

Within calls to startTransaction and commitTransaction, call Model.addNodeData of a node data object that has isGroup: true and whatever other properties you want to set for the new lane.

The Part.movable/copyable/deletable properties only apply to what the user may do. The programmer can always do (almost) anything. http://gojs.net/latest/intro/permissions.html.