|
|
|
@ -47,18 +47,25 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
|
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
popup: { |
|
|
|
|
type: "bi.multi_tree_search_insert_pane", |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, |
|
|
|
|
action: function () { |
|
|
|
|
self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {}; |
|
|
|
|
self._assertShowValue(); |
|
|
|
|
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
|
|
|
|
|
self.combo.setValue(self.storeValue); |
|
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
|
self._stopEditing(); |
|
|
|
|
self._dataChange = true; |
|
|
|
|
listeners: [ |
|
|
|
|
{ |
|
|
|
|
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, |
|
|
|
|
action: function () { |
|
|
|
|
self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {}; |
|
|
|
|
self._assertShowValue(); |
|
|
|
|
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
|
|
|
|
|
self.combo.setValue(self.storeValue); |
|
|
|
|
self.numberCounter.setValue(self.storeValue); |
|
|
|
|
self._stopEditing(); |
|
|
|
|
self._dataChange = true; |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE, |
|
|
|
|
action: function () { |
|
|
|
|
self._dataChange = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
value: { value: o.value || {} } |
|
|
|
@ -79,43 +86,45 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.trigger.setAdapter(this); |
|
|
|
|
self.numberCounter.setAdapter(this); |
|
|
|
|
}, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, |
|
|
|
|
action: function () { |
|
|
|
|
self.numberCounter.adjustView(); |
|
|
|
|
isInit = true; |
|
|
|
|
if (want2showCounter === true) { |
|
|
|
|
showCounter(); |
|
|
|
|
listeners: [ |
|
|
|
|
{ |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_AFTERINIT, |
|
|
|
|
action: function () { |
|
|
|
|
self.numberCounter.adjustView(); |
|
|
|
|
isInit = true; |
|
|
|
|
if (want2showCounter === true) { |
|
|
|
|
showCounter(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CHANGE, |
|
|
|
|
action: function () { |
|
|
|
|
change = true; |
|
|
|
|
var val = { |
|
|
|
|
type: BI.Selection.Multi, |
|
|
|
|
value: this.hasChecked() ? this.getValue() : {} |
|
|
|
|
}; |
|
|
|
|
self.trigger.getSearcher().setState(val); |
|
|
|
|
self.numberCounter.setButtonChecked(val); |
|
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
|
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue()); |
|
|
|
|
self._dataChange = true; |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, |
|
|
|
|
action: function () { |
|
|
|
|
self.combo.hideView(); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, |
|
|
|
|
action: function () { |
|
|
|
|
clear = true; |
|
|
|
|
self._dataChange = true; |
|
|
|
|
self.setValue(); |
|
|
|
|
self._defaultState(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CHANGE, |
|
|
|
|
action: function () { |
|
|
|
|
change = true; |
|
|
|
|
var val = { |
|
|
|
|
type: BI.Selection.Multi, |
|
|
|
|
value: this.hasChecked() ? this.getValue() : {} |
|
|
|
|
}; |
|
|
|
|
self.trigger.getSearcher().setState(val); |
|
|
|
|
self.numberCounter.setButtonChecked(val); |
|
|
|
|
self.storeValue = { value: self.combo.getValue() }; |
|
|
|
|
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue()); |
|
|
|
|
self._dataChange = true; |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, |
|
|
|
|
action: function () { |
|
|
|
|
self.combo.hideView(); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, |
|
|
|
|
action: function () { |
|
|
|
|
clear = true; |
|
|
|
|
self._dataChange = true; |
|
|
|
|
self.setValue(); |
|
|
|
|
self._defaultState(); |
|
|
|
|
} |
|
|
|
|
}], |
|
|
|
|
], |
|
|
|
|
itemsCreator: o.itemsCreator, |
|
|
|
|
onLoaded: function () { |
|
|
|
|
BI.nextTick(function () { |
|
|
|
@ -303,26 +312,28 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
element: this, |
|
|
|
|
items: [{ |
|
|
|
|
el: this.combo, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: triggerBtn, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
items: [this.numberCounter] |
|
|
|
|
}, |
|
|
|
|
right: o.height, |
|
|
|
|
top: 0, |
|
|
|
|
height: o.height, |
|
|
|
|
}] |
|
|
|
|
items: [ |
|
|
|
|
{ |
|
|
|
|
el: this.combo, |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: triggerBtn, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}, { |
|
|
|
|
el: { |
|
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
items: [this.numberCounter] |
|
|
|
|
}, |
|
|
|
|
right: o.height, |
|
|
|
|
top: 0, |
|
|
|
|
height: o.height, |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|