From 2c595008fdff740cf9fd6fb339dd496fac657fa3 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 31 Oct 2013 13:47:12 +0100 Subject: [PATCH] Ox.CheckboxGroup: handle value change --- source/Ox.UI/js/Form/CheckboxGroup.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Ox.UI/js/Form/CheckboxGroup.js b/source/Ox.UI/js/Form/CheckboxGroup.js index 5eb8c2bb..6cbc34f0 100644 --- a/source/Ox.UI/js/Form/CheckboxGroup.js +++ b/source/Ox.UI/js/Form/CheckboxGroup.js @@ -29,6 +29,14 @@ Ox.CheckboxGroup = function(options, self) { }) .options(options || {}) .update({ + value: function() { + self.options.checkboxes.forEach(function(checkbox, index) { + var value = Ox.contains(self.options.value, checkbox.id); + if (checkbox.checked != value) { + toggleCheckbox(index); + } + }); + }, width: function() { self.$checkboxes.forEach(function($checkbox) { $checkbox.options({width: self.options.width});