Browse Source

Merge pull request #71490 in DEC/fineui from master to feature/x

* commit '9c49cfe613ae7facfbee92a3889b09a2eccbf6a6':
  无JIRA fix: 解决复选下拉框时序不一致问题
  无JIRA fix: 解决复选下拉框时序不一致问题
  无JIRA fix: 解决复选下拉框时序不一致问题
  无JIRA  fix: 解决复选下拉框时序不一致问题
es6
superman 3 years ago
parent
commit
2b0700e792
  1. 2
      src/base/combination/searcher.js
  2. 5
      src/widget/multiselect/trigger/button.checkselected.js
  3. 8
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  4. 11
      src/widget/multiselect/trigger/searcher.multiselect.js

2
src/base/combination/searcher.js

@ -183,7 +183,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
keyword: keyword, keyword: keyword,
selectedValues: o.adapter && o.adapter.getValue() selectedValues: o.adapter && o.adapter.getValue()
}, function (searchResult, matchResult) { }, function (searchResult, matchResult) {
if (!self._stop) { if (!self._stop && keyword === self.editor.getValue()) {
var args = [].slice.call(arguments); var args = [].slice.call(arguments);
if (args.length > 0) { if (args.length > 0) {
args.push(keyword); args.push(keyword);

5
src/widget/multiselect/trigger/button.checkselected.js

@ -40,7 +40,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag()); self.numberCounter.setText(self.numberCounter.getTag());
}); });
this.setVisible(false); this.setVisible(false);
if(BI.isNotNull(o.value)){ if (BI.isNotNull(o.value)) {
this.setValue(o.value); this.setValue(o.value);
} }
}, },
@ -51,6 +51,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
o.itemsCreator({ o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { }, function (res) {
if (self.options.value.type !== BI.Selection.All) {
return;
}
if (BI.isNotEmptyString(res.count)) { if (BI.isNotEmptyString(res.count)) {
BI.nextTick(function () { BI.nextTick(function () {
self.numberCounter.setText(res.count); self.numberCounter.setText(res.count);

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

@ -63,7 +63,11 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
var keyword = self.editor.getKeyword(); var keyword = self.editor.getKeyword();
op.keywords = [keyword]; op.keywords = [keyword];
this.setKeyword(keyword); this.setKeyword(keyword);
o.itemsCreator(op, callback); o.itemsCreator(op, function () {
if (keyword === self.editor.getValue()) {
callback.apply(null, arguments);
}
});
}, },
itemHeight: o.itemHeight, itemHeight: o.itemHeight,
value: o.value, value: o.value,
@ -174,7 +178,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
} }
}, },
getState: function() { getState: function () {
return this.editor.getState(); return this.editor.getState();
}, },

11
src/widget/multiselect/trigger/searcher.multiselect.js

@ -51,7 +51,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
callback(); callback();
}, },
el: this.editor, el: this.editor,
popup: BI.extend({ popup: BI.extend({
type: "bi.multi_select_search_pane", type: "bi.multi_select_search_pane",
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
@ -61,7 +60,15 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
var keyword = self.editor.getValue(); var keyword = self.editor.getValue();
op.keywords = [keyword]; op.keywords = [keyword];
o.itemsCreator(op, callback); o.itemsCreator(op, function () {
var keyword = self.editor.getValue();
op.keywords = [keyword];
o.itemsCreator(op, function () {
if (keyword === self.editor.getValue()) {
callback.apply(null, arguments);
}
});
});
}, },
itemHeight: o.itemHeight, itemHeight: o.itemHeight,
value: o.value value: o.value

Loading…
Cancel
Save