Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Bind toArrow with the arrowheads array

$
0
0

@Alpheus wrote:

Hi There,

I am new to GOJS. All i need tis to bind the arrowheads to the toArrow property inspector and change it from Text to Enum/dropdown. please see the code below.

Your help is highly appreciated.
Alpheus

var arrowheads = go.Shape.getArrowheadGeometries().toKeySet().toArray();
if (arrowheads.length % 2 === 1) arrowheads.push(""); // make sure there's an even number

C
// create all of the link data, two arrowheads per link
var linkdata = [];
var i = 0;

for (var i = 0; i < arrowheads.length; i++) {
linkdata.push(arrowheads[i]);
}

//Change
go.Shape._inspectedProperties = {
"toArrow": {
type: "String",
defaultValue: "None"
}}

//To something like this
go.Shape._inspectedProperties = {
"toArrow": {
type: "Enum",
enumValues: [linkdata],
defaultValue: linkdata[0]
}}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles