Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ini untuk datatablenya
- var local = $('#data_table_mhs').DataTable();
- // ini untuk submitnya
- // class check_mhs untuk checkbox isi data
- // class checkAll untuk checkbox trigger select all
- $('#add-mhs-form').submit(function(e){
- if($(".check_mhs:checkbox:checked").length > 0){ // cek jika ada checkbox data yg d select
- var pos = local.$('input, select').serializeArray(); // ini buat kirim data mana aja nilai checkbox yg d kirim sesuai yg d pilih
- $.post("<?php echo site_url('mhs/sendData')?>", pos, function( data ) { ... });
- }
- });
- $(".checkAll").click(function () {
- $('#data_table_mhs tbody input[type="checkbox"], input[class="checkAll"]').prop('checked', this.checked);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement