页面分页动态加载采用冒泡事件动态绑定点击事件
页面的分页,下页的点击事件要采用冒泡机制。
//利用冒泡事件动态加载
$(document).on("click",".edNesAcu",function(){
// $(".edNesAcu").on('click',function(){
//var userBid = $(this).$(".bidInfo").this.parents('tr').find('td').eq('0').text();
var userBid = $(this).parents('tr').find('td').eq('2').text();
alert(userBid);
$('.content_right').remove();
$(".right-product").load(''+url+'/user/compileAccount/'+userBid,function () {
$("#asdf").on('click',function(){
console.log("coming2");
var formData = JSON.stringify($("#formData").serializeObject());
//var userBid = $(".userBid").val();
console.log("userBid: "+userBid);
// console.log(formData);
//账户状态
var status=$('input[name="status"]:checked').val();
// alert("updateStatus: "+status);
//客户组权限
var privilege ="";
console.log( $('#privilege').is(':checked'));
if ($('#privilege').is(':checked')) {
privilege = "1";
} else {
privilege = "0";
}
debugger;
//子账号权限
var businessUnitPrivi = "";
console.log($('#businessUnitPrivi').is(':checked'));
if ($('#businessUnitPrivi').is(':checked')) {
businessUnitPrivi = "1";
} else {
businessUnitPrivi = "0";
}
//服务菜单
var serviceMenu = [];
//商品类目
var serviceType=[];
$('input[name="serviceType"]:checked').each(function(){
serviceType.push($(this).val());
});
console.log("serviceType:"+serviceType);
//账号角色
var roleListBox=[];
$('input[name="roleListBox"]:checked').each(function(){
roleListBox.push($(this).val());
});
console.log("roleListBox:"+roleListBox);
// alert("updateUserBid:"+userBid);
debugger;
$.ajax({
url:url+"/user/update",
type:"post",
dataType:"json",
data:{
"formData":formData,
"userBid":userBid,
"status":status,
"privilege":privilege,
"businessUnitPrivi":businessUnitPrivi,
"serviceMenu":serviceMenu,
"serviceType":serviceType[0],
"roleListBox":roleListBox
},
success:function(res){
console.log(res);
alert("update success");
startPag();
}
});
})
});
});