jQuery.noConflict(); jQuery(document).ready(function(){ // check all checkboxes in table if(jQuery('.checkall').length > 0) { jQuery('.checkall').click(function(){ var parentTable = jQuery(this).parents('table'); var ch = parentTable.find('tbody input[type=checkbox]'); if(jQuery(this).is(':checked')) { //check all rows in table ch.each(function(){ jQuery(this).attr('checked',true); jQuery(this).parent().addClass('checked'); //used for the custom checkbox style jQuery(this).parents('tr').addClass('selected'); // to highlight row as selected }); } else { //uncheck all rows in table ch.each(function(){ jQuery(this).attr('checked',false); jQuery(this).parent().removeClass('checked'); //used for the custom checkbox style jQuery(this).parents('tr').removeClass('selected'); }); } }); } // delete row in a table if(jQuery('.deleterow').length > 0) { jQuery('.deleterow').click(function(){ var conf = confirm('Continue delete?'); if(conf) jQuery(this).parents('tr').fadeOut(function(){ jQuery(this).remove(); // do some other stuff here }); return false; }); } // dynamic table /*if(jQuery('#dyntable').length > 0) { jQuery('#dyntable').dataTable({ "sPaginationType": "full_numbers", "aaSortingFixed": [[0,'asc']], "bJQueryUI": true, "fnDrawCallback": function(oSettings) { jQuery.uniform.update(); } }); }*/ oTable = jQuery('#dyntable').dataTable({ "bPaginate": true, "bJQueryUI": true, "sPaginationType": "full_numbers" }); jQuery("select[name=acoes]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc.php", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) jQuery("select[name=a_not]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc.php?tipo=noticia", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) jQuery("select[name=acoes2]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc2.php", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) jQuery("select[name=acoes3]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc3.php", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) jQuery("select[name=acoes5]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc5.php", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) jQuery("select[name=trab]").change(function() { jQuery("#troca").html('Carregando...'); jQuery.post("opc_trab.php", {var1:jQuery(this).val()}, function(valor){ jQuery("#troca").html(valor); } ) }) });