From 88f978aee36165cdbb41c963917d435ed9fbf599 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 5 Sep 2019 14:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E4=B8=80=E4=B8=8B=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 26 +++++++++++++------ dist/2.0/fineui.js | 26 +++++++++++++------ dist/bundle.ie.js | 26 +++++++++++++------ dist/bundle.js | 26 +++++++++++++------ dist/fineui.ie.js | 26 +++++++++++++------ dist/fineui.js | 26 +++++++++++++------ dist/fineui_without_jquery_polyfill.js | 26 +++++++++++++------ dist/widget.js | 26 +++++++++++++------ .../__test__/dynamicdate.combo.test.js | 23 ++++++++++++++++ .../multilayerselecttree.trigger.js | 13 +++++++--- .../multilayersingletree.trigger.js | 13 +++++++--- 11 files changed, 185 insertions(+), 72 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index f85f09335..4270cea0e 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 5c832fa5c..0e0ce3b38 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index f85f09335..4270cea0e 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -69129,9 +69129,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69238,6 +69236,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69319,7 +69324,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70305,9 +70310,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -70414,6 +70417,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -70496,7 +70506,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/bundle.js b/dist/bundle.js index 5c832fa5c..0e0ce3b38 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -69533,9 +69533,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69642,6 +69640,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69723,7 +69728,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70709,9 +70714,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -70818,6 +70821,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -70900,7 +70910,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 4fd2feb94..5230e323e 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -69374,9 +69374,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69483,6 +69481,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69564,7 +69569,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70550,9 +70555,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -70659,6 +70662,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -70741,7 +70751,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/fineui.js b/dist/fineui.js index 5b902a9c7..d986a75d8 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69778,9 +69778,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -69887,6 +69885,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -69968,7 +69973,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -70954,9 +70959,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -71063,6 +71066,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -71145,7 +71155,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 549d0671b..80ff9b32d 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -52077,9 +52077,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -52186,6 +52184,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -52267,7 +52272,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -53253,9 +53258,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -53362,6 +53365,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -53444,7 +53454,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/dist/widget.js b/dist/widget.js index 180f82c97..40fa95498 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -7187,9 +7187,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -7296,6 +7294,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -7377,7 +7382,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { @@ -8363,9 +8368,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -8472,6 +8475,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -8554,7 +8564,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) { diff --git a/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js b/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js index eb6ff4062..60804a89a 100644 --- a/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js +++ b/src/widget/dynamicdate/__test__/dynamicdate.combo.test.js @@ -82,6 +82,29 @@ describe("DateCombo", function () { }); + /** + * test_author_windy + */ + it("下拉后直接点击外部的触发的confirm", function (done) { + var dateCombo = BI.Test.createWidget({ + type: "bi.dynamic_date_combo", + width: 220, + height: 30 + }); + // 点击日期,是否收起下拉 + dateCombo.element.find(".bi-date-trigger .bi-basic-button").click(); + BI.nextTick(function () { + BI.Test.triggerKeyDown(dateCombo.element.find(".bi-date-trigger .bi-input"), null, BI.KeyCode.ENTER, function () { + BI.delay(function () { + expect(dateCombo.element.find(".bi-date-trigger + .bi-popup-view").css("display")).to.equal("none"); + dateCombo.destroy(); + done(); + }, 300); + }); + }) + + }); + /** * test_author_windy diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index f9312e384..894957496 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -19,9 +19,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -128,6 +126,13 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -209,7 +214,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(items); }, setValue: function (v) { diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 819986c59..66c350231 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -19,9 +19,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { render: function () { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { - this.tree = new BI.Tree(); - this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); - this.tree.initTree(this.nodes); + this._initData(); } var content = { type: "bi.htape", @@ -128,6 +126,13 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }; }, + _initData: function() { + var o = this.options; + this.tree = new BI.Tree(); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); + }, + _getSearchItems: function(keyword) { var o = this.options; // 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索 @@ -210,7 +215,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; - this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); + this._initData(); }, setValue: function (v) {