如何在UI中过滤gojs中的节点?
How to filter nodes in gojs in the UI?
我正在与 go.js 一起研究组织结构图。
我无法弄清楚的一件事是,如何过滤特定节点?是否可以使用 UI 来搜索 go.js 中的节点?[=11=]
org chart static sample 中有一个搜索框,提供了过滤节点的示例。
// 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 的文档。
我正在与 go.js 一起研究组织结构图。
我无法弄清楚的一件事是,如何过滤特定节点?是否可以使用 UI 来搜索 go.js 中的节点?[=11=]
org chart static sample 中有一个搜索框,提供了过滤节点的示例。
// 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 的文档。