$(".DataTable tr:gt(0)").hover(function () {
$(this).css("backgroundColor", "#E8E8E8");
}, function () {
$(this).css("backgroundColor", "white");
});
})
packall = []; //数组声明
function Associationclub(MediumId) {
var selectAll="<div><%: Html.CrsClubEdit("", "")%></div>";
var html = "<div id='AddStart'>"+selectAll;
html+="<div class='ofh AddTodo'><div id='AddToClub' class='h40 pointer fll'>点击添加至下方 + </div><div class='flr' id='clubsum'>0</div></div>";
html+="<div id='Clubs' class='ofh_y ClubsBox' ></div>";
html+="</div>";
var content = {
state1: {
content: html,
buttons: { '保存': 1, '取消': 0 },
buttonsFocus: 0,
submit: function (v, h, f) {
if (v == 0) {
return true; // close the window
}
else {
$.jBox.nextState(); //go forward
// 或 $.jBox.goToState('state2')
}
return false;
}
},
state2: {
content: '添加完成,请关闭:)',
buttons: { '关闭': 1, '取消': 0 },
buttonsFocus: 0,
submit: function (v, h, f) {
if (v == 0) {
return true; // close the window
} else {
//$.jBox.prevState() //go back
// 或 $.jBox.goToState('state1');
}
return false;
}
}
};
$.jBox(content,{title: '设置中介关联球会'});
$(".chzn-select").chosen();
EventFun("#AddToClub","click",function(){
var id=$(".chzn-select").val();
if(id!=""){
if ($.inArray(id, packall) < 0) {
packall.push(id); //加入数组
changClubSum();
$("#Clubs").prepend("<P>"+$(".chzn-select").find("option:selected").text()+"<span class='delClub pointer' onclick=DelClubs('"+id+"',this)>点击删除</span></P>");
} else {
$.jBox.tip("该球会已经加入到该中介!");
}
}else{
$.jBox.tip("请选择球会加入!");
}
});
}
function DelClubs(id,w){
$.jBox.confirm("确认要删除该条记录吗?", "删除提示", function (v, h, f) {
if (v == true) {
$.jBox.tip("成功移除");
$(w).parent().remove();
packall.remove(id); //数组中删除
changClubSum();
}
}, { buttons: { '确定': true, '取消': false} });
};
function changClubSum(){$("#clubsum").html("共计"+packall.length+"家球会");}
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
$(this).css("backgroundColor", "#E8E8E8");
}, function () {
$(this).css("backgroundColor", "white");
});
})
packall = []; //数组声明
function Associationclub(MediumId) {
var selectAll="<div><%: Html.CrsClubEdit("", "")%></div>";
var html = "<div id='AddStart'>"+selectAll;
html+="<div class='ofh AddTodo'><div id='AddToClub' class='h40 pointer fll'>点击添加至下方 + </div><div class='flr' id='clubsum'>0</div></div>";
html+="<div id='Clubs' class='ofh_y ClubsBox' ></div>";
html+="</div>";
var content = {
state1: {
content: html,
buttons: { '保存': 1, '取消': 0 },
buttonsFocus: 0,
submit: function (v, h, f) {
if (v == 0) {
return true; // close the window
}
else {
$.jBox.nextState(); //go forward
// 或 $.jBox.goToState('state2')
}
return false;
}
},
state2: {
content: '添加完成,请关闭:)',
buttons: { '关闭': 1, '取消': 0 },
buttonsFocus: 0,
submit: function (v, h, f) {
if (v == 0) {
return true; // close the window
} else {
//$.jBox.prevState() //go back
// 或 $.jBox.goToState('state1');
}
return false;
}
}
};
$.jBox(content,{title: '设置中介关联球会'});
$(".chzn-select").chosen();
EventFun("#AddToClub","click",function(){
var id=$(".chzn-select").val();
if(id!=""){
if ($.inArray(id, packall) < 0) {
packall.push(id); //加入数组
changClubSum();
$("#Clubs").prepend("<P>"+$(".chzn-select").find("option:selected").text()+"<span class='delClub pointer' onclick=DelClubs('"+id+"',this)>点击删除</span></P>");
} else {
$.jBox.tip("该球会已经加入到该中介!");
}
}else{
$.jBox.tip("请选择球会加入!");
}
});
}
function DelClubs(id,w){
$.jBox.confirm("确认要删除该条记录吗?", "删除提示", function (v, h, f) {
if (v == true) {
$.jBox.tip("成功移除");
$(w).parent().remove();
packall.remove(id); //数组中删除
changClubSum();
}
}, { buttons: { '确定': true, '取消': false} });
};
function changClubSum(){$("#clubsum").html("共计"+packall.length+"家球会");}
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};