Link to home
Start Free TrialLog in
Avatar of Davide Piccolo
Davide Piccolo

asked on

DataTables + iCheck + pagination Issue

iCheck works with datatables only on twenty checkboxes. When I navigate to third and fourth page it shows checkboxes but they don't have iCheck applied. This is code:

$(document).ready(function () {
        $('#datatable').DataTable(//language options)
        });


        $("#datatable input[type='checkbox']").iCheck({
            checkboxClass: 'icheckbox_flat-green',
            //checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_flat-green',
            increaseArea: '20%', // optional
            disabledClass: 'icheckbox_flat-grey'
        });


        $("#datatable_paginate a").on('click', RenderiCheckTblBody());
    });



     function RenderiCheckTblBody() {

         return function () {
             $("#datatable input[type='checkbox']").iCheck({
                 checkboxClass: 'icheckbox_flat-green',
                 //checkboxClass: 'icheckbox_square-green',
                 radioClass: 'iradio_flat-green',
                 increaseArea: '20%', // optional
                 disabledClass: 'icheckbox_flat-grey'
             });
         }
     }

Open in new window


And this is the result:

 User generated image
How can I fix the problem?
ASKER CERTIFIED SOLUTION
Avatar of Prakash Samariya
Prakash Samariya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Davide Piccolo
Davide Piccolo

ASKER

Great!!!!! now works correctly!