Browse Source

无JIRA任务 设置不选multilayertree的getValue问题

es6
windy 6 years ago
parent
commit
d6ce996fba
  1. 10
      src/widget/multilayerselecttree/multilayerselecttree.leveltree.js
  2. 10
      src/widget/multilayersingletree/multilayersingletree.leveltree.js

10
src/widget/multilayerselecttree/multilayerselecttree.leveltree.js

@ -111,9 +111,9 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
el: { el: {
type: "bi.loader", type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn, isDefaultInit: o.itemsCreator !== BI.emptyFn,
chooseType: o.chooseType,
el: { el: {
type: "bi.button_tree", type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors, behaviors: o.behaviors,
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
@ -150,8 +150,12 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
}, },
setValue: function (v) { setValue: function (v) {
this.storeValue = v; // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
this.tree.setValue(v); if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
}, },
getValue: function () { getValue: function () {

10
src/widget/multilayersingletree/multilayersingletree.leveltree.js

@ -110,9 +110,9 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
el: { el: {
type: "bi.loader", type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn, isDefaultInit: o.itemsCreator !== BI.emptyFn,
chooseType: o.chooseType,
el: { el: {
type: "bi.button_tree", type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors, behaviors: o.behaviors,
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
@ -149,8 +149,12 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
}, },
setValue: function (v) { setValue: function (v) {
this.storeValue = v; // getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
this.tree.setValue(v); if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
}, },
getValue: function () { getValue: function () {

Loading…
Cancel
Save