Browse Source

BI-46525 fix: value和异步加载问题

es6
windy 5 years ago
parent
commit
4613f83844
  1. 9
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  2. 4
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  3. 1
      src/widget/multilayerselecttree/multilayerselecttree.popup.js
  4. 9
      src/widget/multilayersingletree/multilayersingletree.combo.js
  5. 4
      src/widget/multilayersingletree/multilayersingletree.leveltree.js
  6. 1
      src/widget/multilayersingletree/multilayersingletree.popup.js

9
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -23,6 +23,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
render: function () {
var self = this, o = this.options;
this.storeValue = BI.isArray(o.value) ? o.value[0] : o.value;
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig();
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : {
@ -139,17 +140,23 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () {
self.trigger.stopEditing();
}
}, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.populate();
}
}]
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.storeValue = v[0];
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
return [this.storeValue];
},
populate: function (items) {

4
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -9,7 +9,6 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-select-level-tree",
isDefaultInit: false,
async: false,
items: [],
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
@ -98,8 +97,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
el: {
type: "bi.loader",
// loader的isDefaultInit为异步加载服务,如果是同步选择不开启
isDefaultInit: o.async,
isDefaultInit: true,
chooseType: o.chooseType,
el: {
type: "bi.button_tree",

1
src/widget/multilayerselecttree/multilayerselecttree.popup.js

@ -26,7 +26,6 @@ BI.MultiLayerSelectTreePopup = BI.inherit(BI.Pane, {
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
async: o.itemsCreator !== BI.emptyFn,
items: o.items,
itemsCreator: function (op, callback) {
(op.times === 1 && !op.node) && BI.nextTick(function () {

9
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -26,6 +26,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
render: function () {
var self = this, o = this.options;
this.storeValue = BI.isArray(o.value) ? o.value[0] : o.value;
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig();
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : {
@ -142,17 +143,23 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () {
self.trigger.stopEditing();
}
}, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.populate();
}
}]
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.storeValue = v[0];
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
return [this.storeValue];
},
populate: function (items) {

4
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -9,7 +9,6 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-single-level-tree",
isDefaultInit: false,
async: false,
items: [],
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
@ -97,8 +96,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
el: {
type: "bi.loader",
// loader的isDefaultInit为异步加载服务,如果是同步选择不开启
isDefaultInit: o.async,
isDefaultInit: true,
chooseType: o.chooseType,
el: {
type: "bi.button_tree",

1
src/widget/multilayersingletree/multilayersingletree.popup.js

@ -25,7 +25,6 @@ BI.MultiLayerSingleTreePopup = BI.inherit(BI.Pane, {
this.tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
isDefaultInit: o.isDefaultInit,
async: o.itemsCreator !== BI.emptyFn,
items: o.items,
itemsCreator: function (op, callback) {
(op.times === 1 && !op.node) && BI.nextTick(function () {

Loading…
Cancel
Save