From ceac7fa94230bc4a4ce9f791e52b45514bac297d Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 1 Mar 2013 10:43:52 +0530 Subject: [PATCH] in form element group, don't throw if an element doesn't have a value method (which allows for adding buttons, for example) --- source/Ox.UI/js/Form/FormElementGroup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Form/FormElementGroup.js b/source/Ox.UI/js/Form/FormElementGroup.js index 28a83e46..2346a08d 100644 --- a/source/Ox.UI/js/Form/FormElementGroup.js +++ b/source/Ox.UI/js/Form/FormElementGroup.js @@ -79,7 +79,7 @@ Ox.FormElementGroup = function(options, self) { function getValue() { var value = self.options.elements.map(function($element) { - return $element.value(); + return $element.value ? $element.value() : void 0; }); return self.options.join ? self.options.join(value) : value; } @@ -93,7 +93,7 @@ Ox.FormElementGroup = function(options, self) { ? self.options.split(self.options.value) : self.options.value; values.forEach(function(value, i) { - self.options.elements[i].value(value); + self.options.elements[i].value && self.options.elements[i].value(value); }); } @@ -116,7 +116,7 @@ Ox.FormElementGroup = function(options, self) { @*/ that.value = function() { var values = self.options.elements.map(function(element) { - return element.value(); + return element.value ? element.value() : void 0; }); return self.options.joinValues ? self.options.joinValues(values)