From 7bdb6567bc26536fcfeac8fd22a16a0fd0f7d7bb Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 29 Aug 2019 10:04:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20fix:=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=90=9C=E7=B4=A2trigger=E5=92=8Cpopup?= =?UTF-8?q?=E5=85=B1=E4=BA=ABitems=E9=9C=80=E8=A6=81clone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/2.0/fineui.ie.js | 35 +++++++----- dist/2.0/fineui.js | 53 +++++++++++++------ dist/bundle.ie.js | 35 +++++++----- dist/bundle.js | 53 +++++++++++++------ dist/fineui.ie.js | 35 +++++++----- dist/fineui.js | 53 +++++++++++++------ dist/fineui_without_jquery_polyfill.js | 53 +++++++++++++------ dist/widget.js | 35 +++++++----- .../multilayerselecttree.trigger.js | 11 ++-- .../node/node.first.plus.js | 1 + .../node/node.last.plus.js | 1 + .../node/node.mid.plus.js | 1 + .../multilayerselecttree/node/node.plus.js | 1 + .../multilayersingletree.trigger.js | 8 +-- 14 files changed, 252 insertions(+), 123 deletions(-) diff --git a/dist/2.0/fineui.ie.js b/dist/2.0/fineui.ie.js index ec3a8d369..14c66cb27 100644 --- a/dist/2.0/fineui.ie.js +++ b/dist/2.0/fineui.ie.js @@ -69124,7 +69124,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69132,7 +69133,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69241,8 +69243,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69315,6 +69317,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -69365,6 +69368,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69468,6 +69472,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69567,6 +69572,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69666,6 +69672,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70297,7 +70304,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -70406,8 +70414,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -70481,6 +70489,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76074,9 +76083,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -76377,9 +76386,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -76693,9 +76702,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); diff --git a/dist/2.0/fineui.js b/dist/2.0/fineui.js index 579a3747f..f8a23ed32 100644 --- a/dist/2.0/fineui.js +++ b/dist/2.0/fineui.js @@ -69528,7 +69528,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69536,7 +69537,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69645,8 +69647,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69719,6 +69721,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -69769,6 +69772,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69872,6 +69876,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69971,6 +69976,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70070,6 +70076,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70701,7 +70708,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -70810,8 +70818,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -70885,6 +70893,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76478,9 +76487,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -76781,9 +76790,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -77097,9 +77106,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -89590,7 +89599,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { } return oldWatch.call(this, model, expOrFn, function () { options && options.store && pushTarget(options.store); - var res = cb.apply(this, arguments); + try { + var res = cb.apply(this, arguments); + } catch (e) { + console.error(e); + } options && options.store && popTarget(); return res; }, options); @@ -89627,7 +89640,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { pushContext(context); pushed = true; } - var result = _create.apply(this, arguments); + try { + var result = _create.apply(this, arguments); + } catch (e) { + console.error(e); + } pushed && popContext(); return result; }; @@ -89636,7 +89653,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { pushContext(this); - var result = old.apply(this, arguments); + try { + var result = old.apply(this, arguments); + } catch (e) { + console.error(e); + } popContext(); return result; }; diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index ec3a8d369..14c66cb27 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -69124,7 +69124,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69132,7 +69133,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69241,8 +69243,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69315,6 +69317,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -69365,6 +69368,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69468,6 +69472,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69567,6 +69572,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69666,6 +69672,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70297,7 +70304,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -70406,8 +70414,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -70481,6 +70489,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76074,9 +76083,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -76377,9 +76386,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -76693,9 +76702,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); diff --git a/dist/bundle.js b/dist/bundle.js index 579a3747f..f8a23ed32 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -69528,7 +69528,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69536,7 +69537,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69645,8 +69647,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69719,6 +69721,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -69769,6 +69772,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69872,6 +69876,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69971,6 +69976,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70070,6 +70076,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70701,7 +70708,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -70810,8 +70818,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -70885,6 +70893,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76478,9 +76487,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -76781,9 +76790,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -77097,9 +77106,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -89590,7 +89599,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { } return oldWatch.call(this, model, expOrFn, function () { options && options.store && pushTarget(options.store); - var res = cb.apply(this, arguments); + try { + var res = cb.apply(this, arguments); + } catch (e) { + console.error(e); + } options && options.store && popTarget(); return res; }, options); @@ -89627,7 +89640,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { pushContext(context); pushed = true; } - var result = _create.apply(this, arguments); + try { + var result = _create.apply(this, arguments); + } catch (e) { + console.error(e); + } pushed && popContext(); return result; }; @@ -89636,7 +89653,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { pushContext(this); - var result = old.apply(this, arguments); + try { + var result = old.apply(this, arguments); + } catch (e) { + console.error(e); + } popContext(); return result; }; diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index 9126af27f..f032073a1 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -69369,7 +69369,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69377,7 +69378,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69486,8 +69488,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69560,6 +69562,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -69610,6 +69613,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69713,6 +69717,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69812,6 +69817,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -69911,6 +69917,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70542,7 +70549,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -70651,8 +70659,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -70726,6 +70734,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76319,9 +76328,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -76622,9 +76631,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -76938,9 +76947,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); diff --git a/dist/fineui.js b/dist/fineui.js index 0c02011d0..fc0328d6e 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69773,7 +69773,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -69781,7 +69782,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -69890,8 +69892,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -69964,6 +69966,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -70014,6 +70017,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70117,6 +70121,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70216,6 +70221,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70315,6 +70321,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -70946,7 +70953,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -71055,8 +71063,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -71130,6 +71138,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -76723,9 +76732,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -77026,9 +77035,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -77342,9 +77351,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -90419,7 +90428,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);(function () { } return oldWatch.call(this, model, expOrFn, function () { options && options.store && pushTarget(options.store); - var res = cb.apply(this, arguments); + try { + var res = cb.apply(this, arguments); + } catch (e) { + console.error(e); + } options && options.store && popTarget(); return res; }, options); @@ -90456,7 +90469,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);(function () { pushContext(context); pushed = true; } - var result = _create.apply(this, arguments); + try { + var result = _create.apply(this, arguments); + } catch (e) { + console.error(e); + } pushed && popContext(); return result; }; @@ -90465,7 +90482,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);(function () { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { pushContext(this); - var result = old.apply(this, arguments); + try { + var result = old.apply(this, arguments); + } catch (e) { + console.error(e); + } popContext(); return result; }; diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index 8a3f713cc..1ac0fe3dc 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -52073,7 +52073,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -52081,7 +52082,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -52190,8 +52192,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -52264,6 +52266,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -52314,6 +52317,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -52417,6 +52421,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -52516,6 +52521,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -52615,6 +52621,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -53246,7 +53253,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -53355,8 +53363,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -53430,6 +53438,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -59023,9 +59032,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -59326,9 +59335,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -59642,9 +59651,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -72135,7 +72144,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { } return oldWatch.call(this, model, expOrFn, function () { options && options.store && pushTarget(options.store); - var res = cb.apply(this, arguments); + try { + var res = cb.apply(this, arguments); + } catch (e) { + console.error(e); + } options && options.store && popTarget(); return res; }, options); @@ -72172,7 +72185,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { pushContext(context); pushed = true; } - var result = _create.apply(this, arguments); + try { + var result = _create.apply(this, arguments); + } catch (e) { + console.error(e); + } pushed && popContext(); return result; }; @@ -72181,7 +72198,11 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () { var old = BI.Loader.prototype[name]; BI.Loader.prototype[name] = function () { pushContext(this); - var result = old.apply(this, arguments); + try { + var result = old.apply(this, arguments); + } catch (e) { + console.error(e); + } popContext(); return result; }; diff --git a/dist/widget.js b/dist/widget.js index 283daeb2f..ced6591b1 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -7184,7 +7184,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -7192,7 +7193,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -7301,8 +7303,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -7375,6 +7377,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -7425,6 +7428,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -7528,6 +7532,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -7627,6 +7632,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -7726,6 +7732,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, @@ -8357,7 +8364,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -8466,8 +8474,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -8541,6 +8549,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { @@ -14134,9 +14143,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); }); @@ -14437,9 +14446,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); @@ -14753,9 +14762,9 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { var checked = this.getSearcher().hasChecked(); var val = { type: BI.Selection.Multi, - value: checked ? this.getValue() : {} + value: checked ? {1: 1} : {} }; - this.getSearcher().setState(val); + this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getCounter().setButtonChecked(val); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); }); diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index b4902a055..90cab85f4 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -11,7 +11,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return v; }, itemsCreator: BI.emptyFn, - watermark: BI.i18nText("BI-Basic_Search") + watermark: BI.i18nText("BI-Basic_Search"), + allowSearchValue: false }; }, @@ -19,7 +20,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -128,8 +130,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -202,6 +204,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) { diff --git a/src/widget/multilayerselecttree/node/node.first.plus.js b/src/widget/multilayerselecttree/node/node.first.plus.js index aadd455c2..ab5e47e33 100644 --- a/src/widget/multilayerselecttree/node/node.first.plus.js +++ b/src/widget/multilayerselecttree/node/node.first.plus.js @@ -30,6 +30,7 @@ BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, diff --git a/src/widget/multilayerselecttree/node/node.last.plus.js b/src/widget/multilayerselecttree/node/node.last.plus.js index a48e14767..1e286399b 100644 --- a/src/widget/multilayerselecttree/node/node.last.plus.js +++ b/src/widget/multilayerselecttree/node/node.last.plus.js @@ -30,6 +30,7 @@ BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, diff --git a/src/widget/multilayerselecttree/node/node.mid.plus.js b/src/widget/multilayerselecttree/node/node.mid.plus.js index a80610160..a7ed22431 100644 --- a/src/widget/multilayerselecttree/node/node.mid.plus.js +++ b/src/widget/multilayerselecttree/node/node.mid.plus.js @@ -30,6 +30,7 @@ BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, diff --git a/src/widget/multilayerselecttree/node/node.plus.js b/src/widget/multilayerselecttree/node/node.plus.js index bfde57f66..bbc34ea5f 100644 --- a/src/widget/multilayerselecttree/node/node.plus.js +++ b/src/widget/multilayerselecttree/node/node.plus.js @@ -30,6 +30,7 @@ BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, { }, id: o.id, pId: o.pId, + keyword: o.keyword, open: o.open, height: o.height, hgap: o.hgap, diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index 5950c5aa8..4ff540e96 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -20,7 +20,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { var self = this, o = this.options; if(o.itemsCreator === BI.emptyFn) { this.tree = new BI.Tree(); - this.tree.initTree(BI.Tree.treeFormat(o.items)); + this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items)); + this.tree.initTree(this.nodes); } var content = { type: "bi.htape", @@ -129,8 +130,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { _getSearchItems: function(keyword) { var o = this.options; - var findingText = BI.Func.getSearchResult(o.items, keyword, "text"); - var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []}; + var findingText = BI.Func.getSearchResult(this.nodes, keyword, "text"); + var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(this.nodes, keyword, "value") : {find: [], match: []}; var textItems = findingText.find.concat(findingText.match); var valueItems = findingValue.find.concat(findingValue.match); return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id")); @@ -204,6 +205,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { populate: function (items) { this.options.items = items; + this.nodes = BI.Tree.treeFormat(BI.deepClone(items)); }, setValue: function (v) {