Browse Source

BI-63192 fix: 修复multi_select_list初始化两次itemsCreator的问题

es6
windy 5 years ago
parent
commit
007b00c2c6
  1. 5
      src/widget/multiselectlist/multiselectlist.insert.js
  2. 5
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  3. 5
      src/widget/multiselectlist/multiselectlist.js

5
src/widget/multiselectlist/multiselectlist.insert.js

@ -46,9 +46,12 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
return self.trigger.getKeyword(); return self.trigger.getKeyword();
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.keywords = [self.trigger.getKeyword()]; var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]); this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
}
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,

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

@ -52,9 +52,12 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
return self.trigger.getKeyword(); return self.trigger.getKeyword();
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.keywords = [self.trigger.getKeyword()]; var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]); this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
}
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,

5
src/widget/multiselectlist/multiselectlist.js

@ -50,10 +50,13 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
return self.trigger.getKeyword(); return self.trigger.getKeyword();
}, },
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.keywords = [self.trigger.getKeyword()]; var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]); this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
} }
}
}); });
this.searcherPane.setVisible(false); this.searcherPane.setVisible(false);

Loading…
Cancel
Save