/*#####################初始化添加表格抬头弹窗图标###########################*/
$(function () {
var tr = $('#GridView1 tr:eq(0)');
tr.find("th").each(function () {
var tmp = $(this).html();
////var patten = new RegExp(/Sort\$\w+/g);
////var result = tmp.match(patten);
////var sort = result[0].replace("Sort$", "");
var title = $(this).text();
// title =title.replace(" ", "=");
if (title == "规格书" || title == "Photo" || title == "商城")
{
}
else {
var strs = "
";
$(this).append(strs);
}
})
})
/*#################################弹窗#######################################*/
function popWin(colname,title) {
// var content = '全选
';
var content = '
';
$.ajax({
type: "POST",
contentType: "application/json",
url: "/inc/DataHandler.ashx?col=" + colname,
dataType: 'json',
success: function (result) {
//绑定列表
$(result).each(function () {
content += "
" + this["val"] + "
";
});
content += "
";
//弹窗
top.$.dialog({ title: title + '-数据筛选', lock: true,
content: content,
max: false, min: false,
close: function () { },
ok: function () {
var sel = '|';
top.$("input[type=radio][name=colval]").each(function () {
if ($(this).attr("checked")) {
sel += $(this).val() + '|';
}
});
if (sel == "|") {
sel = "";
}
else {
var newvalue = sel.replace("|", "").trim();
newvalue = newvalue.replace("|", "").trim();
sel = colname + "$" + sel;
$("#GridView1 tr").not(":first").hide().filter(":contains('" + newvalue + "')").show();
}
return true;
}
}); //end dialog
top.$('#selall').click(function () { selAll(); });
}
}); //end ajax
}
/*#################################弹窗全选#######################################*/
function selAll() {
top.$("input[type=radio][name=colval]").each(function () {
if (top.$('#selall').attr("checked")) {
$(this).attr("checked", 'true');
}
else {
$(this).removeAttr("checked");
}
});
}