drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.38k stars 1.62k forks source link

.prop('checked') does not visually check #246

Closed NickBehrends closed 9 years ago

NickBehrends commented 9 years ago

If I check the checkbox that iCheck creates off of with jquery

$("#" + someCheckbox).prop('checked', true);

then the checkbox is checked however not visually. If I click on the checkbox 2 more times THEN it will visually check it, leading me to believe that it is checked with the property command however the UI is not corresponding until an action is taken. I have also tried things like:

$("#" + someCheckbox).closest('.icheckbox_square-red').children('.iCheck-helper').prop('checked', true);

NickBehrends commented 9 years ago

Figured it out, turns out you have to call update: $('input').iCheck('update');