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

<%@ Register Src="~/UserControl/mobile_head.ascx" TagName="Head" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/mobile_foot.ascx" TagName="Foot" TagPrefix="uc" %>
<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_mykecheng")%></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
    <link type="text/css" href="/Themes/Styles/mobile_index.css" rel="stylesheet" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <style type="text/css">
        #Price { display: none; }
        .fwb1{ display: block;}
    </style>
    <script type="text/javascript">
        $.ajaxSetup({ cache: false });
        $(function () {
            courselist();
        });
        function courselist() {
            var load = QueryString("load");
            if (load == "mycourse") {
                $("#courselist").load("/Training/Learn/Learn_ListMoblie.aspx?action=mycourse");
            } else if (load == "courselist") {
                $("#courselist").load("/Training/Learn/Learn_ListMoblie.aspx?action=courselist");
            }
        }
        function OnType(typeid) {
            var load = QueryString("load");
            if (load == "mycourse") {
                $("#courselist").load("/Training/Learn/Learn_ListMoblie.aspx?action=mycourse&typeid=" + typeid);
            } else {
                $("#courselist").load("/Training/Learn/Learn_ListMoblie.aspx?action=courselist&typeid=" + typeid);
            }
            $("#ClassChild").removeClass("in");
        }

    </script>
</head>
<body>
    <uc:Head ID="Head1" runat="server" />
    <div class="mg50">
        <div class="xkzx pb60">
            <div class="clear" />
            <div id="courselist" style="margin: 0 auto;">
            </div>
        </div>
    </div>
    <script src="/Themes/Scripts/TreeTable/jquery.treeTable.js" type="text/javascript"></script>
    <script type="text/javascript">
         var typelist= <%=kemuStr %>;
        $(function () {
//            var tree = "<%=TableTree_CoursewareType %>";
            //            $("#rwzT").append(tree);
            //$("#rwzT").append("<%=TableTree_CoursewareType %>");
            $("#ClassChildBtn").show();
            GetTreeTable();
                       $("#rwz-table").treeTable({
                        initialState: "collapsed" //collapsed 收缩 expanded展开的
                    });
        });
     //父级
     function GetTreeTable(){
          var eRowIndex = 0;
$.each(typelist,function(i,obj){ 
if (obj.CoursewareType_ParentId="0") {
  var trID=0;
var trID="node-"+eRowIndex;
     $("#rwzT").append("  <tr id=\""+trID+"\"  ><td><span onclick=\"OnType('"+obj.CoursewareType_CtId+"')\">"+obj.CoursewareType_CtName+"</span></td></tr>");
       GetTableTreeNode(obj.CoursewareType_CtId,trID);
          eRowIndex++;
   }
});
}
////子集
function GetTableTreeNode(id,parentTRID){
var ChildIndex=1;
   $.each(typelist,function(i,child){
   if (id==child.CoursewareType_ParentId) {
   var trID=parentTRID+"-"+ChildIndex;
       $("#rwzT").append("<tr id='" + trID + "' class='child-of-" + parentTRID + "'><td><span onclick=\"OnType('"+child.CoursewareType_CtId+"')\">"+child.CoursewareType_CtName+"</span></td></tr>");
       GetTableTreeNode(child.CoursewareType_CtId,trID);
       ChildIndex++;
       }
});
}
    </script>
 
</body>
</html>
