diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 12d622869..ee8dbd9b9 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -23,11 +23,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - var isSync = o.itemsCreator === BI.emptyFn; + var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); - var combo = isSync ? this._getSyncConfig() : this._getAsyncConfig(); - - return !o.allowEdit && isSync ? combo : { + return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { type: "bi.absolute", items: [{ el: combo, diff --git a/src/widget/multilayerselecttree/multilayerselecttree.popup.js b/src/widget/multilayerselecttree/multilayerselecttree.popup.js index cc3a94cfe..b2e904e54 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.popup.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.popup.js @@ -32,7 +32,7 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { self.loading(); }); o.itemsCreator(op, function (ob) { - BI.MultiLayerSelectTreePopup.superclass.populate.apply(self, [ob.items]); + self._populate(ob.items); callback(ob); (op.times === 1 && !op.node) && BI.nextTick(function () { self.loaded(); @@ -64,6 +64,10 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { this.check(); }, + _populate: function() { + BI.MultiLayerSelectTreePopup.superclass.populate.apply(this, arguments); + }, + getValue: function () { return this.tree.getValue(); }, @@ -74,7 +78,7 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, { }, populate: function (items) { - BI.MultiLayerSelectTreePopup.superclass.populate.apply(this, arguments); + this._populate(items); this.tree.populate(items); } }); diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 1b75c8e0b..02b5ef8c3 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -93,10 +93,6 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }, _digest: function (v) { - var o = this.options; - if (!BI.isKey(v)) { - return o.valueFormatter(BI.isFunction(o.text) ? o.text() : o.text); - } return o.valueFormatter(v); }, diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 4ab6547c1..c2312cbcb 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -26,11 +26,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - var isSync = o.itemsCreator === BI.emptyFn; + var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); - var combo = isSync ? this._getSyncConfig() : this._getAsyncConfig(); - - return !o.allowEdit && isSync ? combo : { + return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : { type: "bi.absolute", items: [{ el: combo, diff --git a/src/widget/multilayersingletree/multilayersingletree.popup.js b/src/widget/multilayersingletree/multilayersingletree.popup.js index 12876935e..7e9aca6f9 100644 --- a/src/widget/multilayersingletree/multilayersingletree.popup.js +++ b/src/widget/multilayersingletree/multilayersingletree.popup.js @@ -31,7 +31,7 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { self.loading(); }); o.itemsCreator(op, function (ob) { - BI.MultiLayerSingleTreePopup.superclass.populate.apply(self, [ob.items]); + self._populate(ob.items); callback(ob); (op.times === 1 && !op.node) && BI.nextTick(function () { self.loaded(); @@ -63,6 +63,10 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { this.check(); }, + _populate: function() { + BI.MultiLayerSingleTreePopup.superclass.populate.apply(this, arguments); + }, + getValue: function () { return this.tree.getValue(); }, @@ -73,7 +77,7 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, { }, populate: function (items) { - BI.MultiLayerSingleTreePopup.superclass.populate.apply(this, arguments); + this._populate(items); this.tree.populate(items); } }); diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index f73c97817..bf183ad16 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/src/widget/multilayersingletree/multilayersingletree.trigger.js @@ -93,10 +93,6 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, { }, _digest: function (v) { - var o = this.options; - if (!BI.isKey(v)) { - return o.valueFormatter(BI.isFunction(o.text) ? o.text() : o.text); - } return o.valueFormatter(v); },