Search code examples
ajaxcheckboxuniform

checkbox issue with uniform when fetched using AJAX


I have check boxes with Uniform.js, Today i used AJAX to fetch these check boxes but when i fetch them the style doesn't affect them like in normal page load and also i have one check box in the head that when i check it, all check box must be select so before AJAX i used this code and worked pretty will but with AJAX it also no working.

$('#select_all_messages').change(function(){
var checkboxes = $(this).closest('form').find('[type="checkbox"]');
    if($(this).is(':checked')) {
        checkboxes.prop('checked', true);
    } else {
        checkboxes.prop('checked', false);
    }
    checkboxes.each(function(){
        $.uniform.update($(this));
    });
});

Solution

  • Whoever faces this problem, the solution is to recall the uniform checkbox js functions on AJAX success event.