drgullin / icheck

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

Problem with ajaxs checkbox #60

Closed rumends closed 11 years ago

rumends commented 11 years ago

When I use methods from issue #37 there is a little problem whit this delegation. If you use

$('#mycheckbox').on('ifToggled', function(){
// custom function
});

to bind custom function to specific checkbox after ajaxs trigger 'icheck' there is no bind function to $('#mycheckbox') Is there any solution for this?

drgullin commented 11 years ago

Try this code:

$(document).on('ifToggled', '#mycheckbox', function(){
// custom function
});

This should handle also the ajax loaded inputs.