Browse Source

KERNEL-2638 refactor: search_editor的getValue和searcher的逻辑

es6
windy 5 years ago
parent
commit
af5d691195
  1. 1
      changelog.md
  2. 11
      src/base/combination/searcher.js
  3. 3
      src/widget/editor/editor.search.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2019-12)
- bi.search_editor支持搜索中间含有空格的字符串
- 修复了监听日期下拉框before_popup_view事件,调用setMinDate无效的问题
- 修复了数值滑块逆向排列滑块后populate显示效果不对的问题
- 不影响父节点勾选状态的复选树支持自定义水印和默认值

11
src/base/combination/searcher.js

@ -164,7 +164,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
},
_search: function () {
var self = this, o = this.options, keyword = this.editor.getValue();
var self = this, o = this.options, keyword = this.getLastSearchKeyword();
if (keyword === "" || this._stop) {
return;
}
@ -197,6 +197,13 @@ BI.Searcher = BI.inherit(BI.Widget, {
});
},
getLastSearchKeyword: function () {
if (this.isValid()) {
var res = this.editor.getValue().match(/[\S]+/g);
return BI.isNull(res) ? "" : res[res.length - 1];
}
},
setAdapter: function (adapter) {
this.options.adapter = adapter;
BI.Maskers.remove(this.getName());
@ -258,7 +265,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
},
getKeyword: function () {
return this.editor.getValue();
return this.getLastSearchKeyword();
},
getKeywords: function () {

3
src/widget/editor/editor.search.js

@ -149,8 +149,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
getValue: function () {
if (this.isValid()) {
var res = this.editor.getValue().match(/[\S]+/g);
return BI.isNull(res) ? "" : res[res.length - 1];
return this.editor.getValue();
}
},

Loading…
Cancel
Save