|
|
@ -15,64 +15,44 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_init: function () { |
|
|
|
render: function () { |
|
|
|
var self = this, o = this.options; |
|
|
|
var o = this.options; |
|
|
|
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { |
|
|
|
return { |
|
|
|
self.setValue(newValue); |
|
|
|
type: "bi.text_value_combo", |
|
|
|
}) : o.value; |
|
|
|
ref: (_ref) => { |
|
|
|
o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { |
|
|
|
this.combo = _ref; |
|
|
|
self.populate(newValue); |
|
|
|
}, |
|
|
|
}) : o.items; |
|
|
|
|
|
|
|
BI.SmallTextValueCombo.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
this.trigger = BI.createWidget(o.el, { |
|
|
|
|
|
|
|
type: "bi.small_select_text_trigger", |
|
|
|
|
|
|
|
items: o.items, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
height: o.height, |
|
|
|
text: o.text |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.popup = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.text_value_combo_popup", |
|
|
|
|
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
items: o.items |
|
|
|
el: { |
|
|
|
}); |
|
|
|
type: "bi.small_select_text_trigger", |
|
|
|
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () { |
|
|
|
...o.el |
|
|
|
self.setValue(self.popup.getValue()); |
|
|
|
}, |
|
|
|
self.SmallTextValueCombo.hideView(); |
|
|
|
text: o.text, |
|
|
|
self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE); |
|
|
|
value: o.value, |
|
|
|
}); |
|
|
|
defaultText: o.defaultText, |
|
|
|
this.popup.on(BI.Controller.EVENT_CHANGE, function () { |
|
|
|
allowClear: o.allowClear, |
|
|
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
|
|
status: o.status, |
|
|
|
}); |
|
|
|
title: o.title, |
|
|
|
this.SmallTextValueCombo = BI.createWidget({ |
|
|
|
listeners: [{ |
|
|
|
type: "bi.combo", |
|
|
|
eventName: BI.TextValueCombo.EVENT_CHANGE, |
|
|
|
element: this, |
|
|
|
action: (...args) => { |
|
|
|
container: o.container, |
|
|
|
this.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE, ...args); |
|
|
|
adjustLength: 2, |
|
|
|
|
|
|
|
el: this.trigger, |
|
|
|
|
|
|
|
popup: { |
|
|
|
|
|
|
|
el: this.popup, |
|
|
|
|
|
|
|
maxHeight: 240, |
|
|
|
|
|
|
|
minHeight: 25 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}] |
|
|
|
|
|
|
|
|
|
|
|
if(BI.isKey(o.value)){ |
|
|
|
|
|
|
|
this.setValue(o.value); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
this.trigger.setValue(v); |
|
|
|
this.combo.setValue(v); |
|
|
|
this.popup.setValue(v); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
|
return this.popup.getValue(); |
|
|
|
return this.combo.getValue(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
this.options.items = items; |
|
|
|
this.combo.populate(items); |
|
|
|
this.SmallTextValueCombo.populate(items); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.SmallTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.SmallTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|