Fix et2_checkbox_ro widget for exceptional cases when we pass value as Non-Boolean

This commit is contained in:
Hadi Nategh 2013-10-05 14:04:10 +00:00
parent 43e1bfcc12
commit 54ab073cab

View File

@ -148,8 +148,13 @@ var et2_checkbox_ro = et2_checkbox.extend(
this.setDOMNode(this.span[0]);
},
/**
* note: checkbox is checked if even there is a value but not only if the _value is only "true"
* it's an exceptional validation for cases that we pass non boolean values as checkbox _value
*/
set_value: function(_value) {
if(_value == this.options.selected_value) {
if(_value == this.options.selected_value ||_value && this.options.selected_value == this.__proto__.attributes.selected_value["default"] &&
_value != this.options.unselected_value) {
this.span.text(this.options.ro_true);
this.value = _value;
} else {