drgullin / icheck

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

in 2.x icheck() inside callback function does not work #204

Open zhangmengxue opened 10 years ago

zhangmengxue commented 10 years ago

this does not work: in 2.x $(document).ready(function(){ $('input').icheck({ checkboxClass:'icheckbox-flat-grey', radioClass:'iradio-flat-grey', increaseArea:'20%' }); $("#_hs_select_all").on('ifChecked',function(e){ if($(this).prop('checked')){ $("._hs_item_cb").prop('checked',true).icheck('check'); $("._hs_item_cld_cb").prop('checked',true).icheck('check'); }else{ $("._hs_item_cb").prop('checked',false).icheck('uncheck'); $("._hs_item_cld_cb").prop('checked',false).icheck('uncheck'); } }); }); there is a mistake: Uncaught TypeError: undefined is not a function

please tell me how to do ,it's been a while....

Daijobou commented 10 years ago

You must use icheck('checked') and icheck('unchecked')

Is there not a better way to do this? I must change hundreds of lines to add this code. It should work only with prop('checked',status) without add icheck(status)

drgullin commented 9 years ago

These things are broken right now. This feature will be supported soon.