diff options
author | Wilcley Lima <wilcley@ufl.edu> | 2013-03-05 09:17:19 -0500 |
---|---|---|
committer | Wilcley Lima <wilcley@ufl.edu> | 2013-03-05 09:20:11 -0500 |
commit | db2fa03ffe71ec94d13e4eca40de74f2cdfac2ac (patch) | |
tree | c59de7f64f7a53b4fbb8b6552a59671f98c26ffc /slick.editors.js | |
parent | 948f046dd0fe8a67482134886865e622642312b2 (diff) | |
download | SlickGrid-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.js | 16 |
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 () { |