github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/public/root/js/matrix.tables.js (about)

     1  $(document).ready(function(){
     2  	
     3  	$('.data-table').dataTable({
     4  		"bJQueryUI": true,
     5  		"sPaginationType": "full_numbers",
     6  		"sDom": '<""l>t<"F"fp>'
     7  	});
     8  	
     9  	$('input[type=checkbox],input[type=radio],input[type=file]').uniform();
    10  	
    11  	$('select').select2();
    12  	
    13  	$("span.icon input:checkbox, th input:checkbox").click(function() {
    14  		var checkedStatus = this.checked;
    15  		var checkbox = $(this).parents('.widget-box').find('tr td:first-child input:checkbox');		
    16  		checkbox.each(function() {
    17  			this.checked = checkedStatus;
    18  			if (checkedStatus == this.checked) {
    19  				$(this).closest('.checker > span').removeClass('checked');
    20  			}
    21  			if (this.checked) {
    22  				$(this).closest('.checker > span').addClass('checked');
    23  			}
    24  		});
    25  	});
    26  
    27  	$("#delrows").click(function() {
    28  
    29  		$('#delrowids').attr('value',"");
    30  
    31  	    var oTable = $('.data-table').dataTable();
    32  	    $('input[type=checkbox]:checked', oTable.fnGetNodes()).each( function() {
    33  	    		var v = $('#delrowids').attr('value');
    34  
    35  				if (v != "") {
    36  					v = v + "," + $(this).attr('data');
    37  				}else{
    38  					v = $(this).attr('data');
    39  				};
    40  		       $('#delrowids').attr('value',v);
    41  
    42   		});
    43   		
    44   		if ($('#delrowids').attr('value') != "") {$('#iform').submit();};
    45  
    46  	});
    47  });