js 批量删除获取id用逗号分隔去除最后一个逗号

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014596302/article/details/81914174

js

function deleteAll(){

		// var url = $(this).attr('data-url');
		  var str="";
		  var ids="";
		  $("#${id} tbody tr td input.i-checks:checkbox").each(function(){
		    if(true == $(this).is(':checked')){
		      str+=$(this).attr("id")+",";
		    }
		  });
		  if(str.substr(str.length-1)== ','){
		    ids = str.substr(0,str.length-1);
		  }
		  if(ids == ""){
			top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
			return;
		  }
			top.layer.confirm('确认要彻底删除数据吗?', {icon: 3, title:'系统提示'}, function(index){
			window.location = "${url}?ids="+ids;
		    top.layer.close(index);
		});
		 

	}

 java

遍历删除 
for(String id:ids.split(",")){
				jformResumeInfoService.delJformResumeChild(id,jformResumeChild);
			}

猜你喜欢

转载自blog.csdn.net/u014596302/article/details/81914174
今日推荐