Browse Source

Pull request #2032: BI-90563 fix:传入tipText的不显示toolbar

Merge in VISUAL/fineui from ~JIMMY.CHAI/fineui:master to master

* commit '5fb15f8f0df2fab474810847b09f774acc09674a':
  BI-90563 fix:传入tipText的不显示toolbar
es6
Jimmy.Chai 3 years ago
parent
commit
fe03f3efd6
  1. 9
      src/case/layer/pane.list.js
  2. 8
      src/case/list/list.select.js

9
src/case/layer/pane.list.js

@ -121,11 +121,16 @@ BI.ListPane = BI.inherit(BI.Pane, {
}]); }]);
return; return;
} }
BI.ListPane.superclass.populate.apply(this, arguments);
var context = BI.get(arguments, [2], {}); var context = BI.get(arguments, [2], {});
var tipText = context.tipText || ''; var tipText = context.tipText || '';
BI.isNotEmptyString(tipText) && this.setTipText(tipText); if (BI.isNotEmptyString(tipText)) {
BI.ListPane.superclass.populate.apply(this, []);
this.setTipText(tipText);
} else {
BI.ListPane.superclass.populate.apply(this, arguments);
this.button_group.populate.apply(this.button_group, arguments); this.button_group.populate.apply(this.button_group, arguments);
}
}, },
empty: function () { empty: function () {

8
src/case/list/list.select.js

@ -48,11 +48,13 @@ BI.SelectList = BI.inherit(BI.Widget, {
items: o.items, items: o.items,
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
op.times === 1 && self.toolbar.setVisible(false); op.times === 1 && self.toolbar.setVisible(false);
o.itemsCreator(op, function (items) { o.itemsCreator(op, function (items, keywords, context) {
callback.apply(self, arguments); callback.apply(self, arguments);
if (op.times === 1) { if (op.times === 1) {
self.toolbar.setVisible(items && items.length > 0); var tipText = BI.get(context, 'tipText', '');
self.toolbar.setEnable(self.isEnabled() && items && items.length > 0); var visible = BI.isEmptyString(tipText) && items && items.length > 0;
self.toolbar.setVisible(visible);
self.toolbar.setEnable(self.isEnabled() && visible);
} }
self._checkAllSelected(); self._checkAllSelected();
}); });

Loading…
Cancel
Save