|
|
@ -2,92 +2,132 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
|
return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
baseCls: "bi-text-icon-popup", |
|
|
|
baseCls: "bi-text-icon-popup", |
|
|
|
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE |
|
|
|
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, |
|
|
|
|
|
|
|
allowSelectAll: true, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render () { |
|
|
|
render() { |
|
|
|
var o = this.options, self = this; |
|
|
|
var o = this.options, self = this; |
|
|
|
if (o.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
if (o.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
|
vgap: 5, |
|
|
|
vgap: 5, |
|
|
|
items: [{ |
|
|
|
items: [ |
|
|
|
type: "bi.button_group", |
|
|
|
{ |
|
|
|
ref: (_ref) => { |
|
|
|
type: "bi.button_group", |
|
|
|
this.popup = _ref; |
|
|
|
ref: (_ref) => { |
|
|
|
}, |
|
|
|
this.popup = _ref; |
|
|
|
items: this._formatItems(o.items), |
|
|
|
}, |
|
|
|
chooseType: o.chooseType, |
|
|
|
items: this._formatItems(o.items), |
|
|
|
layouts: [{ |
|
|
|
chooseType: o.chooseType, |
|
|
|
type: "bi.vertical" |
|
|
|
layouts: [ |
|
|
|
}], |
|
|
|
{ |
|
|
|
value: o.value, |
|
|
|
type: "bi.vertical" |
|
|
|
listeners: [{ |
|
|
|
|
|
|
|
eventName: BI.Controller.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function (type, val, obj) { |
|
|
|
|
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
|
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
|
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val, obj); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
}] |
|
|
|
value: o.value, |
|
|
|
}] |
|
|
|
listeners: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
eventName: BI.Controller.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function (type, val, obj) { |
|
|
|
|
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
|
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
|
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val, obj); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
return { |
|
|
|
return { |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
|
verticalAlign: BI.VerticalAlign.Stretch, |
|
|
|
verticalAlign: BI.VerticalAlign.Stretch, |
|
|
|
rowSize: ["fill", ""], |
|
|
|
rowSize: ["fill", ""], |
|
|
|
items: [{ |
|
|
|
items: [ |
|
|
|
type: "bi.select_list", |
|
|
|
{ |
|
|
|
logic: { |
|
|
|
el: o.allowSelectAll ? { |
|
|
|
dynamic: true, |
|
|
|
type: "bi.select_list", |
|
|
|
innerVgap: 5, |
|
|
|
logic: { |
|
|
|
rowSize: ["", "fill"], |
|
|
|
dynamic: true, |
|
|
|
verticalAlign: BI.VerticalAlign.Stretch |
|
|
|
innerVgap: 5, |
|
|
|
}, |
|
|
|
rowSize: ["", "fill"], |
|
|
|
ref: (_ref) => { |
|
|
|
verticalAlign: BI.VerticalAlign.Stretch |
|
|
|
this.popup = _ref; |
|
|
|
}, |
|
|
|
}, |
|
|
|
ref: (_ref) => { |
|
|
|
el: { |
|
|
|
this.popup = _ref; |
|
|
|
el: { |
|
|
|
}, |
|
|
|
chooseType: o.chooseType |
|
|
|
el: { |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
chooseType: o.chooseType, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
items: this._formatItems(o.items), |
|
|
|
|
|
|
|
value: { |
|
|
|
|
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, |
|
|
|
|
|
|
|
value: o.value |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
listeners: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
eventName: BI.SelectList.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function (val) { |
|
|
|
|
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} : { |
|
|
|
|
|
|
|
type: "bi.list_pane", |
|
|
|
|
|
|
|
logic: { |
|
|
|
|
|
|
|
dynamic: true, |
|
|
|
|
|
|
|
innerVgap: 5, |
|
|
|
|
|
|
|
rowSize: ["", "fill"], |
|
|
|
|
|
|
|
verticalAlign: BI.VerticalAlign.Stretch |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
ref: (_ref) => { |
|
|
|
|
|
|
|
this.popup = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
el: { |
|
|
|
|
|
|
|
chooseType: o.chooseType, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
items: this._formatItems(o.items), |
|
|
|
|
|
|
|
value: o.value, |
|
|
|
|
|
|
|
listeners: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
eventName: BI.ListPane.EVENT_CHANGE, |
|
|
|
|
|
|
|
action: function (val) { |
|
|
|
|
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
items: this._formatItems(o.items), |
|
|
|
{ |
|
|
|
value: { |
|
|
|
type: "bi.center", |
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, |
|
|
|
cls: "list-view-toolbar bi-high-light bi-split-top", |
|
|
|
value: o.value |
|
|
|
height: 24, |
|
|
|
}, |
|
|
|
items: BI.createItems([ |
|
|
|
listeners: [{ |
|
|
|
{ |
|
|
|
eventName: BI.SelectList.EVENT_CHANGE, |
|
|
|
type: "bi.text_button", |
|
|
|
action: function (val) { |
|
|
|
text: BI.i18nText("BI-Basic_Clears"), |
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); |
|
|
|
handler: function () { |
|
|
|
} |
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CLEAR); |
|
|
|
}] |
|
|
|
} |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: "bi.center", |
|
|
|
type: "bi.text_button", |
|
|
|
cls: "list-view-toolbar bi-high-light bi-split-top", |
|
|
|
text: BI.i18nText("BI-Basic_OK"), |
|
|
|
height: 24, |
|
|
|
handler: function () { |
|
|
|
items: BI.createItems([{ |
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CONFIRM); |
|
|
|
type: "bi.text_button", |
|
|
|
} |
|
|
|
text: BI.i18nText("BI-Basic_Clears"), |
|
|
|
} |
|
|
|
handler: function () { |
|
|
|
], { |
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CLEAR); |
|
|
|
once: false, |
|
|
|
} |
|
|
|
shadow: true, |
|
|
|
}, { |
|
|
|
isShadowShowingOnSelected: true |
|
|
|
type: "bi.text_button", |
|
|
|
}) |
|
|
|
text: BI.i18nText("BI-Basic_OK"), |
|
|
|
} |
|
|
|
handler: function () { |
|
|
|
] |
|
|
|
self.fireEvent(BI.TextValueComboPopup.EVENT_CONFIRM); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}], { |
|
|
|
|
|
|
|
once: false, |
|
|
|
|
|
|
|
shadow: true, |
|
|
|
|
|
|
|
isShadowShowingOnSelected: true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -117,6 +157,9 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
return this.popup.getValue(); |
|
|
|
return this.popup.getValue(); |
|
|
|
} |
|
|
|
} |
|
|
|
var val = this.popup.getValue(); |
|
|
|
var val = this.popup.getValue(); |
|
|
|
|
|
|
|
if (!this.options.allowSelectAll) { |
|
|
|
|
|
|
|
return val; |
|
|
|
|
|
|
|
} |
|
|
|
if (val.type === BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
if (val.type === BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
return val.value; |
|
|
|
return val.value; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -128,6 +171,10 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
if (this.options.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
if (this.options.chooseType !== BI.ButtonGroup.CHOOSE_TYPE_MULTI) { |
|
|
|
return this.popup.setValue(v); |
|
|
|
return this.popup.setValue(v); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.options.allowSelectAll) { |
|
|
|
|
|
|
|
this.popup.setValue(v); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
this.popup.setValue({ |
|
|
|
this.popup.setValue({ |
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, |
|
|
|
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, |
|
|
|
value: v |
|
|
|
value: v |
|
|
|