guy 8 years ago
parent
commit
208c832597
  1. 8
      demo/js/widget/demo.multiselectcombo.js
  2. 6
      dist/core.js
  3. 6
      src/core/widget.js

8
demo/js/widget/demo.multiselectcombo.js

@ -45,10 +45,14 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
_itemsCreator: function (options, callback) { _itemsCreator: function (options, callback) {
var self = this; var self = this;
var items = ITEMS; var items = ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) { if (options.keyword) {
var search = BI.Func.getSearchResult(items, options.keyword); keywords.push(options.keyword);
items = search.matched.concat(search.finded);
} }
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.matched.concat(search.finded);
});
if (options.selected_values) {//过滤 if (options.selected_values) {//过滤
var filter = BI.makeObject(options.selected_values, true); var filter = BI.makeObject(options.selected_values, true);
items = BI.filter(items, function (i, ob) { items = BI.filter(items, function (i, ob) {

6
dist/core.js vendored

@ -14518,6 +14518,7 @@ BI.Widget = BI.inherit(BI.OB, {
this.options.invisible = true; this.options.invisible = true;
this.element.hide(); this.element.hide();
} }
this.fireEvent(BI.Events.VIEW, visible);
}, },
setValid: function (valid) { setValid: function (valid) {
@ -14663,7 +14664,10 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
destroy: function () { destroy: function () {
this._unMount(); this.empty();
this._isMounted = false;
this._parent = null;
this.destroyed();
this.element.destroy(); this.element.destroy();
this.fireEvent(BI.Events.DESTROY); this.fireEvent(BI.Events.DESTROY);
} }

6
src/core/widget.js

@ -220,6 +220,7 @@ BI.Widget = BI.inherit(BI.OB, {
this.options.invisible = true; this.options.invisible = true;
this.element.hide(); this.element.hide();
} }
this.fireEvent(BI.Events.VIEW, visible);
}, },
setValid: function (valid) { setValid: function (valid) {
@ -365,7 +366,10 @@ BI.Widget = BI.inherit(BI.OB, {
}, },
destroy: function () { destroy: function () {
this._unMount(); this.empty();
this._isMounted = false;
this._parent = null;
this.destroyed();
this.element.destroy(); this.element.destroy();
this.fireEvent(BI.Events.DESTROY); this.fireEvent(BI.Events.DESTROY);
} }

Loading…
Cancel
Save