jquery - dataTables : javascript not working while paging -


i using datatable creating table , working fine. table consists of checkbox (column1) , select (last column). javascript enable select when checkbox selected. while page next page, javascript of enabling/disabling not working. selects enabled.

javascript

<script> var update_selectopt=function(){ $("tr").each(function(){     if($("input[type='checkbox']", this).is(":checked")){         $('#select',this).removeattr('disabled');     }     else     {       $('#select',this).attr('disabled','disabled');      }     });   };   $(update_selectopt); $("input[type='checkbox']").on("click",update_selectopt);  </script> 

how manage that?

fire update_selectopt function after paging event has happened on table:

$('#table_ws').on( 'page.dt', function () {     update_selectopt(); }); 

edit

try this:

$('#table_ws').on( 'draw.dt', function () {     update_selectopt(); }); 

documentation on page event here


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -