diff --git a/bi/core.js b/bi/core.js index af4d547e47..7d6a750201 100644 --- a/bi/core.js +++ b/bi/core.js @@ -10403,6 +10403,19 @@ $.extend(BI, { } else { return [sNodes]; } + }, + + traversal: function (array, callback) { + if (BI.isNull(array)) { + return; + } + var self = this; + BI.any(array, function (i, item) { + if (callback(i, item) === false) { + return true; + } + self.traversal(item.children, callback); + }) } }) })();//向量操作 diff --git a/docs/core.js b/docs/core.js index e1ec3a400f..14ffbdf521 100644 --- a/docs/core.js +++ b/docs/core.js @@ -18862,6 +18862,19 @@ $.extend(BI, { } else { return [sNodes]; } + }, + + traversal: function (array, callback) { + if (BI.isNull(array)) { + return; + } + var self = this; + BI.any(array, function (i, item) { + if (callback(i, item) === false) { + return true; + } + self.traversal(item.children, callback); + }) } }) })();//向量操作 diff --git a/src/core/utils/tree.js b/src/core/utils/tree.js index 51ac0f23ba..139dedce12 100644 --- a/src/core/utils/tree.js +++ b/src/core/utils/tree.js @@ -464,6 +464,19 @@ } else { return [sNodes]; } + }, + + traversal: function (array, callback) { + if (BI.isNull(array)) { + return; + } + var self = this; + BI.any(array, function (i, item) { + if (callback(i, item) === false) { + return true; + } + self.traversal(item.children, callback); + }) } }) })(); \ No newline at end of file