Browse Source

无JIRA fix: 解决复选下拉框时序不一致问题

es6
zsmj 2 years ago
parent
commit
c2c7c06083
  1. 4
      src/widget/multiselect/multiselect.combo.js
  2. 4
      src/widget/multiselect/multiselect.insert.combo.js
  3. 6
      src/widget/multiselect/trigger/searcher.multiselect.insert.js

4
src/widget/multiselect/multiselect.combo.js

@ -284,13 +284,11 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
var self = this; var self = this;
var o = this.options; var o = this.options;
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
var args = Array.prototype.slice.call(arguments);
if (op.times === 1 && BI.isNotNull(op.keywords)) { if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉 // 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue())); self.trigger.setValue(BI.deepClone(self.getValue()));
} }
args.push(op); callback.apply(self, arguments);
callback.apply(self, args);
}); });
}, },

4
src/widget/multiselect/multiselect.insert.combo.js

@ -285,13 +285,11 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
_itemsCreator4Trigger: function (op, callback) { _itemsCreator4Trigger: function (op, callback) {
var self = this, o = this.options; var self = this, o = this.options;
o.itemsCreator(op, function (res) { o.itemsCreator(op, function (res) {
var args = Array.prototype.slice.call(arguments);
if (op.times === 1 && BI.isNotNull(op.keywords)) { if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉 // 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue())); self.trigger.setValue(BI.deepClone(self.getValue()));
} }
args.push(op); callback.apply(self, arguments);
callback.apply(self, args);
}); });
}, },

6
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -62,12 +62,10 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var keyword = self.editor.getKeyword(); var keyword = self.editor.getKeyword();
op.keywords = [keyword]; op.keywords = [keyword];
self.op = op;
this.setKeyword(keyword); this.setKeyword(keyword);
o.itemsCreator(op, function () { o.itemsCreator(op, function () {
var args = Array.prototype.slice.call(arguments); if (keyword === self.editor.getValue()) {
if (BI.last(args) === self.op) { callback.apply(null, arguments);
callback.apply(null, args);
} }
}); });
}, },

Loading…
Cancel
Save