summaryrefslogtreecommitdiffstats
path: root/slick.editors.js
diff options
context:
space:
mode:
authorWilcley Lima <wilcley@ufl.edu>2013-03-05 09:17:19 -0500
committerWilcley Lima <wilcley@ufl.edu>2013-03-05 09:20:11 -0500
commitdb2fa03ffe71ec94d13e4eca40de74f2cdfac2ac (patch)
treec59de7f64f7a53b4fbb8b6552a59671f98c26ffc /slick.editors.js
parent948f046dd0fe8a67482134886865e622642312b2 (diff)
downloadSlickGrid-db2fa03ffe71ec94d13e4eca40de74f2cdfac2ac.zip
SlickGrid-db2fa03ffe71ec94d13e4eca40de74f2cdfac2ac.tar.gz
SlickGrid-db2fa03ffe71ec94d13e4eca40de74f2cdfac2ac.tar.bz2
incorporated suggestions by mleibman
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 () {