|
|
@ -8,11 +8,11 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// invalid: true,
|
|
|
|
// invalid: true,
|
|
|
|
iconCls1: "dot-e-font", |
|
|
|
iconCls1: "dot-e-font", |
|
|
|
|
|
|
|
icon: "", |
|
|
|
iconCls2: "pull-right-e-font" |
|
|
|
iconCls2: "pull-right-e-font" |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
render: function () { |
|
|
|
BI.DownListGroupItem.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
@ -21,9 +21,17 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
textAlign: "left", |
|
|
|
textAlign: "left", |
|
|
|
text: o.text, |
|
|
|
text: o.text, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
height: o.height |
|
|
|
height: o.height, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (BI.isPlainObject(o.icon)) { |
|
|
|
|
|
|
|
this.icon1 = BI.createWidget({ |
|
|
|
|
|
|
|
width: 36, |
|
|
|
|
|
|
|
height: o.height, |
|
|
|
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
|
|
|
items: [o.icon], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
this.icon1 = BI.createWidget({ |
|
|
|
this.icon1 = BI.createWidget({ |
|
|
|
type: "bi.icon_button", |
|
|
|
type: "bi.icon_button", |
|
|
|
cls: o.iconCls1, |
|
|
|
cls: o.iconCls1, |
|
|
@ -32,8 +40,9 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
iconHeight: o.iconHeight, |
|
|
|
iconHeight: o.iconHeight, |
|
|
|
iconWidth: 36, |
|
|
|
iconWidth: 36, |
|
|
|
disableSelected: true, |
|
|
|
disableSelected: true, |
|
|
|
selected: this._digest(o.value) |
|
|
|
selected: this._digest(o.value), |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.icon2 = BI.createWidget({ |
|
|
|
this.icon2 = BI.createWidget({ |
|
|
|
type: "bi.icon_button", |
|
|
|
type: "bi.icon_button", |
|
|
@ -42,27 +51,6 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
forceNotSelected: true |
|
|
|
forceNotSelected: true |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var blank = BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.layout", |
|
|
|
|
|
|
|
width: 24 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
|
|
|
|
type: "bi.absolute", |
|
|
|
|
|
|
|
element: this, |
|
|
|
|
|
|
|
items: [{ |
|
|
|
|
|
|
|
el: this.icon2, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0, |
|
|
|
|
|
|
|
right: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BI.createWidget(BI.extend({ |
|
|
|
|
|
|
|
element: this |
|
|
|
|
|
|
|
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { |
|
|
|
|
|
|
|
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon1, this.text, blank) |
|
|
|
|
|
|
|
})))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.element.hover(function () { |
|
|
|
this.element.hover(function () { |
|
|
|
if (self.isEnabled()) { |
|
|
|
if (self.isEnabled()) { |
|
|
|
self.hover(); |
|
|
|
self.hover(); |
|
|
@ -72,6 +60,12 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
self.dishover(); |
|
|
|
self.dishover(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
type: "bi.horizontal_fill", |
|
|
|
|
|
|
|
columnSize: [36, "fill", 24], |
|
|
|
|
|
|
|
items: [this.icon1, this.text, this.icon2] |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getLevel: function () { |
|
|
|
_getLevel: function () { |
|
|
@ -117,8 +111,8 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
this.icon1.setSelected(this._digest(v)); |
|
|
|
this.icon1.setSelected && this.icon1.setSelected(this._digest(v)); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.shortcut("bi.down_list_group_item", BI.DownListGroupItem); |
|
|
|
BI.shortcut("bi.down_list_group_item", BI.DownListGroupItem); |