Browse Source

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

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

9
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();
this.setKeyword(op.keywords[0]); if (BI.isNotEmptyString(keyword)) {
o.itemsCreator(op, callback); op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,

9
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();
this.setKeyword(op.keywords[0]); if (BI.isNotEmptyString(keyword)) {
o.itemsCreator(op, callback); op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
}, },
listeners: [{ listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,

9
src/widget/multiselectlist/multiselectlist.js

@ -50,9 +50,12 @@ 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();
this.setKeyword(op.keywords[0]); if (BI.isNotEmptyString(keyword)) {
o.itemsCreator(op, callback); op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
} }
}); });
this.searcherPane.setVisible(false); this.searcherPane.setVisible(false);

Loading…
Cancel
Save