diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index af9a14614..14f8cb5f4 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -10,7 +10,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { errorText: "", watermark: BI.i18nText("BI-Basic_Search"), validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn + quitChecker: BI.emptyFn, + value: "" }); }, _init: function () { @@ -32,7 +33,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.clear = BI.createWidget({ type: "bi.icon_button", stopEvent: true, - cls: "close-font" + cls: "close-font", + invisible: BI.isKey(o.value) }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue(""); @@ -123,8 +125,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.editor.on(BI.Editor.EVENT_STOP, function () { self.fireEvent(BI.SearchEditor.EVENT_STOP); }); - - this.clear.invisible(); }, _checkClear: function () { @@ -214,4 +214,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor); \ No newline at end of file +BI.shortcut("bi.search_editor", BI.SearchEditor);