Browse Source

BI-51490 fix: 文本列表粘贴值逻辑和下拉框同步

es6
windy 5 years ago
parent
commit
50c0ac8ae0
  1. 20
      src/widget/multiselectlist/multiselectlist.insert.js
  2. 20
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  3. 20
      src/widget/multiselectlist/multiselectlist.js

20
src/widget/multiselectlist/multiselectlist.insert.js

@ -210,16 +210,14 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -320,8 +318,6 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

20
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -218,16 +218,14 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -330,8 +328,6 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

20
src/widget/multiselectlist/multiselectlist.js

@ -192,16 +192,14 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
@ -332,8 +330,6 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}

Loading…
Cancel
Save