|
|
|
@ -20,14 +20,28 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
|
|
|
|
|
textRgap: 0 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
_init: function () { |
|
|
|
|
BI.MultiSelectItem.superclass._init.apply(this, arguments); |
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
this.checkbox = BI.createWidget({ |
|
|
|
|
type: "bi.checkbox" |
|
|
|
|
}); |
|
|
|
|
this.text = BI.createWidget({ |
|
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
|
self.setSelected(self.isSelected()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return { |
|
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
columnSize: [o.iconWrapperWidth || o.height, "fill"], |
|
|
|
|
items: [{ |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [this.checkbox] |
|
|
|
|
}, { |
|
|
|
|
type: "bi.label", |
|
|
|
|
ref: function (_ref) { |
|
|
|
|
self.text = _ref; |
|
|
|
|
}, |
|
|
|
|
cls: "list-item-text", |
|
|
|
|
textAlign: "left", |
|
|
|
|
whiteSpace: "nowrap", |
|
|
|
@ -40,32 +54,18 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
|
|
|
|
|
keyword: o.keyword, |
|
|
|
|
value: o.value, |
|
|
|
|
py: o.py |
|
|
|
|
}); |
|
|
|
|
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { |
|
|
|
|
if (type === BI.Events.CLICK) { |
|
|
|
|
self.setSelected(self.isSelected()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
BI.createWidget(BI.extend({ |
|
|
|
|
element: this |
|
|
|
|
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { |
|
|
|
|
items: BI.LogicFactory.createLogicItemsByDirection("left", { |
|
|
|
|
type: "bi.center_adapt", |
|
|
|
|
items: [this.checkbox], |
|
|
|
|
width: o.iconWrapperWidth |
|
|
|
|
}, this.text) |
|
|
|
|
})))); |
|
|
|
|
}] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_setEnable: function (enable) { |
|
|
|
|
BI.MultiSelectItem.superclass._setEnable.apply(this, arguments); |
|
|
|
|
if (enable === true) { |
|
|
|
|
this.element.attr("tabIndex", 1); |
|
|
|
|
} else if (enable === false) { |
|
|
|
|
this.element.removeAttr("tabIndex"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// _setEnable: function (enable) {
|
|
|
|
|
// BI.MultiSelectItem.superclass._setEnable.apply(this, arguments);
|
|
|
|
|
// if (enable === true) {
|
|
|
|
|
// this.element.attr("tabIndex", 1);
|
|
|
|
|
// } else if (enable === false) {
|
|
|
|
|
// this.element.removeAttr("tabIndex");
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
doRedMark: function () { |
|
|
|
|
this.text.doRedMark.apply(this.text, arguments); |
|
|
|
|