3

I am working on an org chart with go.js.

One thing I am not able to figure out is, how do I filter on particular nodes? Is it possible to have a UI for searching nodes in go.js?

xfscrypt
  • 16
  • 5
  • 28
  • 59

1 Answers1

3

There's a search box in the org chart static sample that gives an example of filtering nodes.

// create a case insensitive RegExp from what the user typed
var regex = new RegExp(input.value, "i");

...

// search four different data properties for the string, any of which may match for success
var results = myDiagram.findNodesByExample({ name: regex },
                                           { nation: regex },
                                           { title: regex },
                                           { headOf: regex });

See the documentation for findNodesByExample for more information.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171