⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rcpopedomtable.js

📁 一个很好的asp cms管理系统
💻 JS
字号:
function RCPopedomTable(objName)
{
	this.name = objName;
	this.width = "500px";
	this.head_bgColor = "#666666";
}

RCPopedomTable.prototype.toString = function ()
{
	var oTable = document.getElementById("myTable" + this.name);
	if(oTable) return "";

	var str = "";
		str = "" +
		"<table width=\"700\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" class=\"tabBgColor\">" +
        "  <tr align=\"center\" class=\"tabHead\"> " +
        "    <td width=\"70\" height=\"14\" align=\"center\">Id</td>" +
        "    <td width=\"120\" align=\"center\">分类名称</td>" +
        "    <td width=\"460\" align=\"center\">权限类型</td>" +
        "    <td width=\"30\" align=\"center\">根</td>" +
        "  </tr>" +
        "  <tr valign=\"top\"> " +
        "    <td colspan=\"4\" bgcolor=\"#FFFFFF\">" +
		"	<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"myTable" + this.name + "\">" +
        "    </table>" +	
		"	  </td>" +
        "  </tr>" +
        "  <tr align=\"right\" valign=\"top\">" +
        "    <td height=\"14\" colspan=\"4\" bgcolor=\"#FFFFFF\">[<a href=\"javascript:" + this.name + ".RCSelector_Open_all();void(0);\">添加</a>]</td>" +
        "  </tr>" +
        "</table>";
	return str;
}

RCPopedomTable.prototype.RCSelector_Open_all = function ()
{
	var result = RCSelector_Open_all(1, '', '请选择频道', 1);
	if(!result) return false;
	this.InsertNewClassPopedom(result[0]);
}

RCPopedomTable.prototype.DeleteThisRow = function (rcid)
{
	var RowIndex = -1;
	var oTable = document.getElementById("myTable" + this.name);
	var oRow = null;
	for(var i=0;i<oTable.rows.length; i++)
	{
		oRow = oTable.rows[i];
		if(oRow.rcid == rcid)
		{
			RowIndex = i;
			break;
		}
	}
	if(RowIndex != -1)
	{
		oTable.deleteRow(RowIndex);
	}
}

RCPopedomTable.prototype.InsertNewClassPopedom = function (result, pope_flag, root_node)
{
	var oTable = document.getElementById("myTable" + this.name);
	
	//初始化权限标识
	if(!pope_flag)
	{
		pope_flag = "0000000000";
	}

	if(document.getElementById("ResClassPopedom" + result.id + this.name))
	{
		alert("已存在此频道");
		return false;
	}

	var oRow = oTable.insertRow();
	oRow.rcid = result.id;
	oRow.style.className = "tabRow1";
	var oCell = null;
	oCell = oRow.insertCell();
	oCell.width = "10";
	oCell.innerHTML = "<a href=\"javascript:" + this.name + ".DeleteThisRow(" + result.id + ");void(0);\"><img src=\"img/del.gif\" border=\"0\"></a>";

	oCell = oRow.insertCell();
	oCell.width = "60";
	oCell.innerHTML = "<input type=\"hidden\" name=\"ResClassPopedom" + this.name + "\" id=\"ResClassPopedom" + result.id + this.name + "\" value=\"" + result.id + "\">" + result.id;

	oCell = oRow.insertCell();
	oCell.width = "120";
	oCell.innerHTML = result.title;

	oCell = oRow.insertCell();
	oCell.align = "center";
	oCell.width = "460";
	oCell.innerHTML = "<input type=\"checkbox\" name=\"flag1_" + result.id + this.name + "\" id=\"flag1_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 10)?"checked":"") + ">" +
					  "<label for=\"flag1_" + result.id + this.name + "\" title=\"浏览资源\">浏览</label> "+
                      "<input type=\"checkbox\" name=\"flag2_" + result.id + this.name + "\" id=\"flag2_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 9)?"checked":"") + "> "+
                      "<label for=\"flag2_" + result.id + this.name + "\" title=\"增加资源\">增加</label>  "+
                      "<input type=\"checkbox\" name=\"flag3_" + result.id + this.name + "\" id=\"flag3_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 8)?"checked":"") + "> "+
                      "<label for=\"flag3_" + result.id + this.name + "\" title=\"修改资源\">修改</label>  "+
                      "<input type=\"checkbox\" name=\"flag4_" + result.id + this.name + "\" id=\"flag4_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 7)?"checked":"") + "> "+
                      "<label for=\"flag4_" + result.id + this.name + "\" title=\"删除资源\">删除</label>  "+
                      "<input type=\"checkbox\" name=\"flag5_" + result.id + this.name + "\" id=\"flag5_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 6)?"checked":"") + "> "+
                      "<label for=\"flag5_" + result.id + this.name + "\" title=\"审核资源\">审核</label>  "+
                      "<input type=\"checkbox\" name=\"flag6_" + result.id + this.name + "\" id=\"flag6_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 5)?"checked":"") + "> "+
                      "<label for=\"flag6_" + result.id + this.name + "\" title=\"更新碎片、碎片包\">碎片</label>  "+
                      "<input type=\"checkbox\" name=\"flag7_" + result.id + this.name + "\" id=\"flag7_" + result.id + this.name + "\" value=\"1\" " + (this.getPopeFlag(pope_flag, 4)?"checked":"") + "> "+
                      "<label for=\"flag7_" + result.id + this.name + "\" title=\"共享频道、栏目\">共享</label>  ";

	oCell = oRow.insertCell();
	oCell.width = "30";
	oCell.align = "center";
	oCell.innerHTML = "<input type=\"checkbox\" name=\"root_" + result.id + this.name + "\" id=\"root_" + result.id + this.name + "\" value=\"1\" " + (root_node?"checked":"") + ">";
}

RCPopedomTable.prototype.getPopeFlag = function(pope_flag, pos)
{
	if(!pope_flag) return false;		
	return (pope_flag.substr(pos-1, 1) == "1");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -