guy 7 years ago
parent
commit
8e6f703125
  1. 52
      bi/widget.js
  2. 52
      dist/bundle.js
  3. 14
      dist/bundle.min.js
  4. 52
      dist/widget.js
  5. 52
      src/widget/multiselect/multiselect.combo.js

52
bi/widget.js

@ -8637,19 +8637,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue(""); self._setStartValue("");
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) { // if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword(); var keyword = this.getSearcher().getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self._setStartValue(keyword); self._setStartValue(keyword);
assertShowValue(); assertShowValue();
self.populate(); self.populate();
self._setStartValue(""); self._setStartValue("");
}) })
} // }
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords); var last = BI.last(keywords);
@ -8864,30 +8868,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH // type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;

52
dist/bundle.js vendored

@ -87116,19 +87116,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue(""); self._setStartValue("");
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) { // if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword(); var keyword = this.getSearcher().getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self._setStartValue(keyword); self._setStartValue(keyword);
assertShowValue(); assertShowValue();
self.populate(); self.populate();
self._setStartValue(""); self._setStartValue("");
}) })
} // }
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords); var last = BI.last(keywords);
@ -87343,30 +87347,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH // type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;

14
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

52
dist/widget.js vendored

@ -8637,19 +8637,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue(""); self._setStartValue("");
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) { // if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword(); var keyword = this.getSearcher().getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self._setStartValue(keyword); self._setStartValue(keyword);
assertShowValue(); assertShowValue();
self.populate(); self.populate();
self._setStartValue(""); self._setStartValue("");
}) })
} // }
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords); var last = BI.last(keywords);
@ -8864,30 +8868,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH // type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;

52
src/widget/multiselect/multiselect.combo.js

@ -59,19 +59,23 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._setStartValue(""); self._setStartValue("");
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) { // if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword(); var keyword = this.getSearcher().getKeyword();
self._join({ self._join({
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: [keyword] value: [keyword]
}, function () { }, function () {
//如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
self.storeValue.value.pushDistinct(keyword);
}
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self._setStartValue(keyword); self._setStartValue(keyword);
assertShowValue(); assertShowValue();
self.populate(); self.populate();
self._setStartValue(""); self._setStartValue("");
}) })
} // }
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) { this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords); var last = BI.last(keywords);
@ -286,30 +290,32 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
_adjust: function (callback) { _adjust: function (callback) {
var self = this, o = this.options; var self = this, o = this.options;
if (!this._count) { // if (!this._count) {
o.itemsCreator({ // o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH // type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) { // }, function (res) {
self._count = res.count; // self._count = res.count;
adjust(); // adjust();
callback(); // callback();
}); // });
} else { // } else {
adjust(); adjust();
callback(); callback();
}
// }
function adjust() { function adjust() {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) { // if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.Multi, // type: BI.Selection.Multi,
value: [] // value: []
} // }
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) { // } else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = { // self.storeValue = {
type: BI.Selection.All, // type: BI.Selection.All,
value: [] // value: []
} // }
} // }
if (self.wants2Quit === true) { if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false; self.wants2Quit = false;

Loading…
Cancel
Save