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