Browse Source

KERNEL-702 feat: 树下拉可配trigger默认显示文本 && simple_state_editor和state_editor同步

es6
windy 6 years ago
parent
commit
645c4685c4
  1. 10
      src/case/editor/editor.state.simple.js
  2. 1
      src/widget/multitree/multi.tree.insert.combo.js
  3. 1
      src/widget/multitree/multi.tree.list.combo.js
  4. 1
      src/widget/multitree/trigger/searcher.multi.tree.js

10
src/case/editor/editor.state.simple.js

@ -21,7 +21,8 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
allowBlank: true, allowBlank: true,
watermark: "", watermark: "",
errorText: "", errorText: "",
height: 24 height: 24,
text: BI.i18nText("BI-Basic_Unrestricted")
}); });
}, },
@ -48,8 +49,8 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
type: "bi.text_button", type: "bi.text_button",
cls: "state-editor-infinite-text", cls: "state-editor-infinite-text",
textAlign: "left", textAlign: "left",
text: o.text,
height: o.height, height: o.height,
text: BI.i18nText("BI-Basic_Unrestricted"),
hgap: 4, hgap: 4,
handler: function () { handler: function () {
self._showInput(); self._showInput();
@ -218,6 +219,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
}, },
setState: function (v) { setState: function (v) {
var o = this.options;
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments); BI.SimpleStateEditor.superclass.setValue.apply(this, arguments);
if (BI.isNumber(v)) { if (BI.isNumber(v)) {
if (v === BI.Selection.All) { if (v === BI.Selection.All) {
@ -227,7 +229,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.text.setText(BI.i18nText("BI-Already_Selected")); this.text.setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("state-editor-infinite-text"); this.text.element.removeClass("state-editor-infinite-text");
} else { } else {
this.text.setText(BI.i18nText("BI-Basic_Unrestricted")); this.text.setText(o.text);
this.text.element.addClass("state-editor-infinite-text"); this.text.element.addClass("state-editor-infinite-text");
} }
return; return;
@ -237,7 +239,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.text.setTitle(v); this.text.setTitle(v);
this.text.element.removeClass("state-editor-infinite-text"); this.text.element.removeClass("state-editor-infinite-text");
} else if (BI.isEmpty(v)) { } else if (BI.isEmpty(v)) {
this.text.setText(BI.i18nText("BI-Basic_Unrestricted")); this.text.setText(o.text);
this.text.element.addClass("state-editor-infinite-text"); this.text.element.addClass("state-editor-infinite-text");
} else { } else {
this.text.setText(BI.i18nText("BI-Already_Selected")); this.text.setText(BI.i18nText("BI-Already_Selected"));

1
src/widget/multitree/multi.tree.insert.combo.js

@ -46,6 +46,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}, },
searcher: { searcher: {
type: "bi.multi_tree_searcher", type: "bi.multi_tree_searcher",
text: o.text,
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
popup: { popup: {
type: "bi.multi_tree_search_insert_pane", type: "bi.multi_tree_search_insert_pane",

1
src/widget/multitree/multi.tree.list.combo.js

@ -38,6 +38,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
text: o.text,
height: o.height, height: o.height,
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
// adapter: this.popup, // adapter: this.popup,

1
src/widget/multitree/trigger/searcher.multi.tree.js

@ -28,6 +28,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
height: o.height, height: o.height,
el: { el: {
type: "bi.simple_state_editor", type: "bi.simple_state_editor",
text: o.text,
height: o.height height: o.height
} }
}); });

Loading…
Cancel
Save