|
|
@ -20,14 +20,28 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { |
|
|
|
textRgap: 0 |
|
|
|
textRgap: 0 |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
|
|
|
|
BI.MultiSelectItem.superclass._init.apply(this, arguments); |
|
|
|
render: function () { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
this.checkbox = BI.createWidget({ |
|
|
|
this.checkbox = BI.createWidget({ |
|
|
|
type: "bi.checkbox" |
|
|
|
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", |
|
|
|
type: "bi.label", |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.text = _ref; |
|
|
|
|
|
|
|
}, |
|
|
|
cls: "list-item-text", |
|
|
|
cls: "list-item-text", |
|
|
|
textAlign: "left", |
|
|
|
textAlign: "left", |
|
|
|
whiteSpace: "nowrap", |
|
|
|
whiteSpace: "nowrap", |
|
|
@ -40,32 +54,18 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { |
|
|
|
keyword: o.keyword, |
|
|
|
keyword: o.keyword, |
|
|
|
value: o.value, |
|
|
|
value: o.value, |
|
|
|
py: o.py |
|
|
|
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) { |
|
|
|
// _setEnable: function (enable) {
|
|
|
|
BI.MultiSelectItem.superclass._setEnable.apply(this, arguments); |
|
|
|
// BI.MultiSelectItem.superclass._setEnable.apply(this, arguments);
|
|
|
|
if (enable === true) { |
|
|
|
// if (enable === true) {
|
|
|
|
this.element.attr("tabIndex", 1); |
|
|
|
// this.element.attr("tabIndex", 1);
|
|
|
|
} else if (enable === false) { |
|
|
|
// } else if (enable === false) {
|
|
|
|
this.element.removeAttr("tabIndex"); |
|
|
|
// this.element.removeAttr("tabIndex");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
}, |
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
doRedMark: function () { |
|
|
|
doRedMark: function () { |
|
|
|
this.text.doRedMark.apply(this.text, arguments); |
|
|
|
this.text.doRedMark.apply(this.text, arguments); |
|
|
|