diff options
author | Fabio Kfouri <kfouri.fabio@gmail.com> | 2015-05-21 09:55:18 -0300 |
---|---|---|
committer | Fabio Kfouri <kfouri.fabio@gmail.com> | 2015-05-21 09:55:21 -0300 |
commit | a1fb33303765df90ff92bcd78da874bfae17e983 (patch) | |
tree | 4381ef9426dcdd6b5f4395fdbe114317c6081efa /jquery.multiple.select.js | |
parent | d4d3aa4535989205baf9cc2b42850c0c53e77a7d (diff) | |
download | multiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.zip multiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.tar.gz multiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.tar.bz2 |
This improvement fix the problem described at Issue # 188, that when all child of a Group were set as true, the parent group was not set as true automatically.
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r-- | jquery.multiple.select.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js index b8f2338..7fd5549 100644 --- a/jquery.multiple.select.js +++ b/jquery.multiple.select.js @@ -416,6 +416,14 @@ }); this.$selectAll.prop('checked', this.$selectItems.length === this.$selectItems.filter(':checked').length); + + $.each(that.$selectGroups, function (i, val) { + var group = $(val).parent().attr('data-group'), + $children = that.$selectItems.filter('[data-group="' + group + '"]'); + $(val).prop('checked', $children.length && + $children.length === $children.filter(':checked').length); + }); + this.update(); }, |