<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomGroup_List.aspx.cs"
    Inherits="RM.Web.Training.CustomGroup.CustomGroup_List" %>

<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/TreeTable/jquery.treeTable.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/TreeTable/css/jquery.treeTable.css" rel="stylesheet"
        type="text/css" />
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <uc2:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div class="div-body">
        <table class="example" id="dnd-example">
            <thead>
                <tr>
                    <td style="padding-left: 20px; width: 20%;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%>
                    </td>
                    <td style="display: none;">
                    </td>
                    <td style="padding-left: 20px;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_miaoshu")%>
                    </td>
                    <td style="padding-left: 20px;">
                       <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learningnumbers")%>
                    </td>
                    <td style="padding-left: 20px;">
                       <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CustomGroupDepartment")%>
                    </td>
                </tr>
            </thead>
            <tbody>
                <%=TableTree_CoursewareType.ToString()%>
            </tbody>
        </table>
    </div>
    </form>
    <script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(90);
            FixedTableHeader("#table1", $(window).height() - 121);
            GetClickTableValue();
        })
        /**
        获取table TD值
        主键ID
        column:列名
        **/
        var Menu_Id = '';
        function GetClickTableValue() {
            $('table tr').not('#td').click(function () {
                $(this).find('td').each(function (i) {
                    if (i == 1) {
                        Menu_Id = $(this).text();
                    }
                });
            });
            $("#dnd-example").treeTable({
                initialState: "collapsed" //collapsed 收缩 expanded展开的
            });
        }

        //添加
        function add() {
            var url = "/Training/CustomGroup/CustomGroup_Form.aspx?mid=" + Menu_Id;
            top.openDialog(url, 'CustomExam_Form_Add', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Add")%>', 950, 550, 50, 50);
        }
        //编辑
        function edit() {
            var key = Menu_Id;
            if (IsEditdata(key)) {
                var url = "/Training/CustomGroup/CustomGroup_Form.aspx?key=" + key;
                top.openDialog(url, 'CustomExam_Form_Edit', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>', 950, 550, 50, 50);
            }
        }
        //删除
        function Delete() {
            var key = Menu_Id;
            if (IsEditdata(key)) {
                var delparm = 'action=Virtualdelete&module=<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("group_zdyfzmc")%>&tableName=TKS_CustomGroup&pkName=CGID&pkVal=' + key;
                delConfig('/Ajax/Common_Ajax.ashx', delparm);
            }
        } 
    </script>
</body>
</html>
