Browse Source

Merge pull request #302 in ~GUY/fineui from ~WINDY/fineui:master to master

* commit '36c9740606f99cbe7fb718d907daf442c3539a9a':
  multiselectcombo和multiselecttree支持value
es6
windy 7 years ago
parent
commit
ed02ce8d8e
  1. 6
      demo/js/widget/multiselect/demo.multi_select_combo.js
  2. 5
      demo/js/widget/multitree/demo.multi_tree_combo.js
  3. 8
      dist/base.js
  4. 108
      dist/bundle.js
  5. 11
      dist/case.js
  6. 11
      dist/demo.js
  7. 108
      dist/fineui.js
  8. 89
      dist/widget.js
  9. 3
      src/base/layer/layer.popup.js
  10. 5
      src/base/tree/treeview.js
  11. 3
      src/case/editor/editor.state.js
  12. 3
      src/case/editor/editor.state.simple.js
  13. 3
      src/case/list/list.select.js
  14. 2
      src/case/trigger/trigger.icon.text.js
  15. 6
      src/component/allvaluechooser/combo.allvaluechooser.js
  16. 2
      src/widget/multiselect/check/multiselect.check.pane.js
  17. 4
      src/widget/multiselect/multiselect..insert.combo.js
  18. 9
      src/widget/multiselect/multiselect.combo.js
  19. 6
      src/widget/multiselect/multiselect.loader.js
  20. 6
      src/widget/multiselect/multiselect.popup.view.js
  21. 6
      src/widget/multiselect/multiselect.trigger.js
  22. 3
      src/widget/multiselect/search/multiselect.search.loader.js
  23. 3
      src/widget/multiselect/search/multiselect.search.pane.js
  24. 5
      src/widget/multiselect/trigger/button.checkselected.js
  25. 3
      src/widget/multiselect/trigger/editor.multiselect.js
  26. 6
      src/widget/multiselect/trigger/searcher.multiselect.js
  27. 6
      src/widget/multiselect/trigger/switcher.checkselected.js
  28. 3
      src/widget/multitree/check/multi.tree.check.pane.js
  29. 9
      src/widget/multitree/multi.tree.combo.js
  30. 3
      src/widget/multitree/multi.tree.popup.js
  31. 3
      src/widget/multitree/multi.tree.search.pane.js
  32. 6
      src/widget/multitree/trigger/searcher.multi.tree.js

6
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -11,7 +11,11 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var widget = BI.createWidget({
type: "bi.multi_select_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
width: 200,
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

5
demo/js/widget/multitree/demo.multi_tree_combo.js

@ -35,7 +35,10 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
items: items
});
},
width: 300
width: 300,
value: {
"根目录": {}
}
}, {
type: "bi.button",
text: "getValue",

8
dist/base.js vendored

@ -1535,6 +1535,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -1550,7 +1551,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -15438,7 +15441,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},

108
dist/bundle.js vendored

@ -27408,6 +27408,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -27423,7 +27424,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -41311,7 +41314,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},
@ -69561,6 +69565,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -69835,6 +69842,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -70461,6 +70471,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -76069,7 +76082,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text
@ -85521,7 +85534,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -85735,7 +85748,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -85844,6 +85858,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -86066,7 +86081,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -86091,7 +86109,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -86196,6 +86215,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -86446,6 +86466,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -86512,7 +86535,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -86611,7 +86635,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -86622,7 +86647,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -86717,7 +86743,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -86739,7 +86766,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -86849,13 +86877,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -87024,7 +87053,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -87101,7 +87131,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -87125,6 +87155,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -87183,7 +87216,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -87286,7 +87320,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -87311,6 +87346,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -87430,7 +87468,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -87446,7 +87485,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -88452,7 +88492,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -88535,6 +88576,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -88554,7 +88597,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -88610,12 +88654,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -88792,7 +88836,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -88888,7 +88933,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -89052,7 +89098,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -89073,6 +89120,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -97671,7 +97721,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

11
dist/case.js vendored

@ -7271,6 +7271,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -7545,6 +7548,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -8171,6 +8177,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -13779,7 +13788,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text

11
dist/demo.js vendored

@ -12621,7 +12621,11 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var widget = BI.createWidget({
type: "bi.multi_select_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200
width: 200,
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
@ -12727,7 +12731,10 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
items: items
});
},
width: 300
width: 300,
value: {
"根目录": {}
}
}, {
type: "bi.button",
text: "getValue",

108
dist/fineui.js vendored

@ -29102,6 +29102,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -29117,7 +29118,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {
@ -43005,7 +43008,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},
@ -71255,6 +71259,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -71529,6 +71536,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {
@ -72155,6 +72165,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
@ -77763,7 +77776,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text
@ -87215,7 +87228,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -87429,7 +87442,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -87538,6 +87552,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -87760,7 +87775,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -87785,7 +87803,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -87890,6 +87909,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -88140,6 +88160,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -88206,7 +88229,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -88305,7 +88329,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -88316,7 +88341,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -88411,7 +88437,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -88433,7 +88460,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -88543,13 +88571,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -88718,7 +88747,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -88795,7 +88825,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -88819,6 +88849,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -88877,7 +88910,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -88980,7 +89014,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -89005,6 +89040,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -89124,7 +89162,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -89140,7 +89179,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -90146,7 +90186,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -90229,6 +90270,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -90248,7 +90291,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -90304,12 +90348,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -90486,7 +90530,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -90582,7 +90627,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -90746,7 +90792,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -90767,6 +90814,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -99365,7 +99415,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

89
dist/widget.js vendored

@ -9120,7 +9120,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
@ -9334,7 +9334,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -9443,6 +9444,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -9665,7 +9667,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -9690,7 +9695,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -9795,6 +9801,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
@ -10045,6 +10052,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -10111,7 +10121,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -10210,7 +10221,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -10221,7 +10233,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
@ -10316,7 +10329,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -10338,7 +10352,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);
@ -10448,13 +10463,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
@ -10623,7 +10639,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -10700,7 +10717,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -10724,6 +10741,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {
@ -10782,7 +10802,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
@ -10885,7 +10906,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -10910,6 +10932,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
@ -11029,7 +11054,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -11045,7 +11071,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
@ -12051,7 +12078,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
@ -12134,6 +12162,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -12153,7 +12183,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -12209,12 +12240,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空
@ -12391,7 +12422,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({
@ -12487,7 +12519,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {
@ -12651,7 +12684,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -12672,6 +12706,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
@ -21270,7 +21307,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

3
src/base/layer/layer.popup.js

@ -115,7 +115,8 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs
items: o.tabs,
value: o.value
});
},

5
src/base/tree/treeview.js

@ -14,6 +14,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
@ -29,7 +30,9 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
this.setSelectedValue(o.value);
}
},
_createTree: function () {

3
src/case/editor/editor.state.js

@ -129,6 +129,9 @@ BI.StateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {

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

@ -130,6 +130,9 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
doRedMark: function () {

3
src/case/list/list.select.js

@ -80,6 +80,9 @@ BI.SelectList = BI.inherit(BI.Widget, {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {

2
src/case/trigger/trigger.icon.text.js

@ -52,7 +52,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: o.triggerWidth || o.height
width: BI.isEmptyString(o.iconCls)? 0 : (o.triggerWidth || o.height)
},
{
el: this.text

6
src/component/allvaluechooser/combo.allvaluechooser.js

@ -31,7 +31,11 @@ BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {

2
src/widget/multiselect/check/multiselect.check.pane.js

@ -26,7 +26,7 @@ BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
this.storeValue = {};
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,

4
src/widget/multiselect/multiselect..insert.combo.js

@ -48,7 +48,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: o.value
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -157,6 +158,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}

9
src/widget/multiselect/multiselect.combo.js

@ -23,7 +23,10 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = {};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
@ -48,7 +51,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
callback.apply(self, arguments);
});
}
},
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
@ -153,6 +157,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}

6
src/widget/multiselect/multiselect.loader.js

@ -27,6 +27,9 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
@ -93,7 +96,8 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
},
hasNext: function () {
return hasNext;
}
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

6
src/widget/multiselect/multiselect.popup.view.js

@ -25,7 +25,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
@ -36,7 +37,8 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {

6
src/widget/multiselect/multiselect.trigger.js

@ -41,7 +41,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
@ -63,7 +64,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK);

3
src/widget/multiselect/search/multiselect.search.loader.js

@ -20,13 +20,14 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {

3
src/widget/multiselect/search/multiselect.search.pane.js

@ -43,7 +43,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
}
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

5
src/widget/multiselect/trigger/button.checkselected.js

@ -19,7 +19,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
@ -43,6 +43,9 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
setValue: function (ob) {

3
src/widget/multiselect/trigger/editor.multiselect.js

@ -25,7 +25,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true
allowBlank: true,
value: o.value
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {

6
src/widget/multiselect/trigger/searcher.multiselect.js

@ -47,7 +47,8 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
op.keyword = self.editor.getValue();
this.setKeyword(op.keyword);
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -72,6 +73,9 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {

6
src/widget/multiselect/trigger/switcher.checkselected.js

@ -24,7 +24,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
@ -40,7 +41,8 @@ BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker

3
src/widget/multitree/check/multi.tree.check.pane.js

@ -62,7 +62,8 @@ BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
}
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {

9
src/widget/multitree/multi.tree.combo.js

@ -31,6 +31,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
@ -50,7 +52,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: "bi.multi_tree_check_pane",
itemsCreator: o.itemsCreator
}
}
},
value: {value: o.value || {}}
});
@ -106,12 +109,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
});
}
},
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.storeValue = {value: {}};
var change = false;
var clear = false; // 标识当前是否点击了清空

3
src/widget/multitree/multi.tree.popup.js

@ -27,7 +27,8 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded
onLoaded: opts.onLoaded,
value: opts.value || {}
});
this.popupView = BI.createWidget({

3
src/widget/multitree/multi.tree.search.pane.js

@ -27,7 +27,8 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
}
},
value: opts.value
});
this.partTree.on(BI.Controller.EVENT_CHANGE, function () {

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

@ -49,7 +49,8 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
}
},
value: o.value
}, o.popup),
adapter: o.adapter,
@ -70,6 +71,9 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {

Loading…
Cancel
Save