3

我正在使用 go.js 制作组织结构图。

我无法弄清楚的一件事是,如何过滤特定节点?是否有可能在 go.js 中有一个用于搜索节点的 UI?

4

1 回答 1

3

组织结构图静态示例中有一个搜索框,其中提供了过滤节点的示例。

// 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 });

有关更多信息,请参阅findNodesByExample的文档。

于 2015-08-02T14:17:08.850 回答