|
|
@ -22,7 +22,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
var isInit = false; |
|
|
|
var isInit = false; |
|
|
|
var want2showCounter = false; |
|
|
|
var want2showCounter = false; |
|
|
|
|
|
|
|
|
|
|
|
this.storeValue = {value: o.value || {}}; |
|
|
|
this.storeValue = { value: o.value || {} }; |
|
|
|
|
|
|
|
|
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
type: "bi.multi_select_trigger", |
|
|
|
type: "bi.multi_select_trigger", |
|
|
@ -30,6 +30,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
height: o.height - (o.simple ? 1 : 2), |
|
|
|
height: o.height - (o.simple ? 1 : 2), |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
|
|
|
|
defaultText: o.defaultText, |
|
|
|
watermark: o.watermark, |
|
|
|
watermark: o.watermark, |
|
|
|
// adapter: this.popup,
|
|
|
|
// adapter: this.popup,
|
|
|
|
masker: { |
|
|
|
masker: { |
|
|
@ -44,7 +45,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
type: "bi.multi_tree_searcher", |
|
|
|
type: "bi.multi_tree_searcher", |
|
|
|
itemsCreator: o.itemsCreator |
|
|
|
itemsCreator: o.itemsCreator |
|
|
|
}, |
|
|
|
}, |
|
|
|
value: {value: o.value || {}} |
|
|
|
value: { value: o.value || {} } |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.combo = BI.createWidget({ |
|
|
|
this.combo = BI.createWidget({ |
|
|
@ -105,7 +106,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
maxWidth: o.isNeedAdjustWidth ? "auto" : 500, |
|
|
|
maxWidth: o.isNeedAdjustWidth ? "auto" : 500, |
|
|
|
}, |
|
|
|
}, |
|
|
|
isNeedAdjustWidth: o.isNeedAdjustWidth, |
|
|
|
isNeedAdjustWidth: o.isNeedAdjustWidth, |
|
|
|
value: {value: o.value || {}}, |
|
|
|
value: { value: o.value || {} }, |
|
|
|
hideChecker: function (e) { |
|
|
|
hideChecker: function (e) { |
|
|
|
return triggerBtn.element.find(e.target).length === 0 && |
|
|
|
return triggerBtn.element.find(e.target).length === 0 && |
|
|
|
self.numberCounter.element.find(e.target).length === 0; |
|
|
|
self.numberCounter.element.find(e.target).length === 0; |
|
|
@ -131,12 +132,12 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { |
|
|
|
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { |
|
|
|
self.storeValue = {value: self.combo.getValue()}; |
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
this.setValue(self.storeValue); |
|
|
|
this.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { |
|
|
|
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { |
|
|
|
self.storeValue = {value: this.getValue()}; |
|
|
|
self.storeValue = { value: this.getValue() }; |
|
|
|
self.combo.setValue(self.storeValue); |
|
|
|
self.combo.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
BI.nextTick(function () { |
|
|
|
BI.nextTick(function () { |
|
|
@ -151,11 +152,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING); |
|
|
|
self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function showCounter () { |
|
|
|
function showCounter() { |
|
|
|
if (isSearching()) { |
|
|
|
if (isSearching()) { |
|
|
|
self.storeValue = {value: self.trigger.getValue()}; |
|
|
|
self.storeValue = { value: self.trigger.getValue() }; |
|
|
|
} else if (isPopupView()) { |
|
|
|
} else if (isPopupView()) { |
|
|
|
self.storeValue = {value: self.combo.getValue()}; |
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
} |
|
|
|
} |
|
|
|
self.trigger.setValue(self.storeValue); |
|
|
|
self.trigger.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
@ -174,7 +175,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
var checked = this.getSearcher().hasChecked(); |
|
|
|
var checked = this.getSearcher().hasChecked(); |
|
|
|
var val = { |
|
|
|
var val = { |
|
|
|
type: BI.Selection.Multi, |
|
|
|
type: BI.Selection.Multi, |
|
|
|
value: checked ? {1: 1} : {} |
|
|
|
value: checked ? { 1: 1 } : {} |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); |
|
|
|
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); |
|
|
|
self.numberCounter.setButtonChecked(val); |
|
|
|
self.numberCounter.setButtonChecked(val); |
|
|
@ -186,7 +187,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (change === true) { |
|
|
|
if (change === true) { |
|
|
|
self.storeValue = {value: self.combo.getValue()}; |
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
change = false; |
|
|
|
change = false; |
|
|
|
} |
|
|
|
} |
|
|
|
self.combo.setValue(self.storeValue); |
|
|
|
self.combo.setValue(self.storeValue); |
|
|
@ -201,9 +202,9 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (isPopupView()) { |
|
|
|
if (isPopupView()) { |
|
|
|
self._stopEditing(); |
|
|
|
self._stopEditing(); |
|
|
|
self.storeValue = {value: self.combo.getValue()}; |
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
if (clear === true) { |
|
|
|
if (clear === true) { |
|
|
|
self.storeValue = {value: {}}; |
|
|
|
self.storeValue = { value: {} }; |
|
|
|
} |
|
|
|
} |
|
|
|
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); |
|
|
|
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM); |
|
|
|
} |
|
|
|
} |
|
|
@ -245,7 +246,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
valueFormatter: o.valueFormatter, |
|
|
|
value: {value: o.value || {}} |
|
|
|
value: { value: o.value || {} } |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () { |
|
|
|
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () { |
|
|
|
if (!self.combo.isViewVisible()) { |
|
|
|
if (!self.combo.isViewVisible()) { |
|
|
@ -306,7 +307,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_stopEditing: function() { |
|
|
|
_stopEditing: function () { |
|
|
|
this.trigger.stopEditing(); |
|
|
|
this.trigger.stopEditing(); |
|
|
|
this.numberCounter.hideView(); |
|
|
|
this.numberCounter.hideView(); |
|
|
|
}, |
|
|
|
}, |
|
|
|