Your setCheckboxes() JS function implementation does not trigger onChange() event for checkboxes and I need this for my project.
I changed your function a little so now it's more jQuery'sh and triggers change event.
Here is updated function.
function setCheckboxes(state) {
$('input:checkbox', checkBoxes).each(function() { $(this).attr('checked', state).change(); });
}
Comments
Comment #1
markus_petrux commentedHow about this?
...it needs a bit less resources to execute than using jQuery to alter the checkbox status, plus this is compatible with all browsers, AFAIK.
Comment #2
vgarvardt commentedThis will work too.
If you want you can use mixed code style. As for me I don't think that setting attribute using jQuery API takes much time.
Comment #3
markus_petrux commentedWell, I ended up committing a slightly different version of this.
There's no need to use the jQuery each() iterator, and it is now 100% jQuery-ish.
I have also added blur() effect to click events. I'll pack a new release with these changes that should be available as soon as the packaging system proceeds.
Also, I've changed to issue status to "Feature request" as this was not really a bug.
And then... I'm going to write a new version that will also work in tables, where more than one set of checkboxes exist. I'll leave than one in DEV stage for a while...
Comment #4
markus_petrux commented