summaryrefslogtreecommitdiffstats
path: root/slick.editors.js
diff options
context:
space:
mode:
Diffstat (limited to 'slick.editors.js')
-rw-r--r--slick.editors.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/slick.editors.js b/slick.editors.js
index a0b0dee..f3ef8e9 100644
--- a/slick.editors.js
+++ b/slick.editors.js
@@ -302,22 +302,16 @@
};
this.loadValue = function (item) {
- defaultValue = item[args.column.field];
+ defaultValue = !!item[args.column.field];
if (defaultValue) {
- defaultValue = true;
$select.attr("checked", "checked");
} else {
- defaultValue = false;
$select.removeAttr("checked");
}
};
this.serializeValue = function () {
- if ($select.attr("checked") === 'checked') {
- return true;
- } else {
- return false;
- }
+ return !!$select.attr("checked");
};
this.applyValue = function (item, state) {
@@ -325,11 +319,7 @@
};
this.isValueChanged = function () {
- if ($select.attr("checked") === 'checked') {
- return !defaultValue;
- } else {
- return defaultValue;
- }
+ return (this.serializeValue() !== defaultValue);
};
this.validate = function () {