当前位置: 代码迷 >> JavaScript >> jquery的导航页面4(nodeDocPage.jsp续)
  详细解决方案

jquery的导航页面4(nodeDocPage.jsp续)

热度:792   发布时间:2012-11-05 09:35:11.0
jquery的导航页面四(nodeDocPage.jsp续)
    function initPageFromAssociation() {
        $("div#navi_subnode_div").empty();
        $("div#navi_toolbar_div").empty();
        initToolBar();
        $("div#navi_toolbar_div > span").each(
        function() {
        toolBarHover($(this));
        }
        );
 
        // 设置隐藏itemID(i)的值
        <%
        String last_item_id = "";
        String last_item_name = "";
        String last_item_level = "";
        List navigation_toolbar_list = (List)request.getAttribute("navigation_toolbar_list");

        if( navigation_toolbar_list != null && navigation_toolbar_list.size() > 0) {
            int length = navigation_toolbar_list.size();
           
            last_item_id = (String) ((Map) navigation_toolbar_list.get(length - 1)).get("item_id");
            last_item_name = (String) ((Map) navigation_toolbar_list.get(length - 1)).get("item_name");
            last_item_level = (String) ((Map) navigation_toolbar_list.get(length - 1)).get("level");
           
            for(int i = 0; i < length; i++) {
                Map map = (Map) navigation_toolbar_list.get(i);
                String item_id = (String) map.get("item_id");
                String item_name = (String) map.get("item_name");
        %>
        $("#itemId" + "<%=i%>").val("<%=item_id%>");
        <%
            }
        }%>
        $("#itemId").val("<%=last_item_id%>");
        $("#level_id").val("<%=last_item_level%>");

//设置默认的文档类型
    $("#materialType").val(selected_doc_type);
          
        var node=$("<a href='#' id='"+ $("#itemId").val() +"' level='"+ $("#level_id").val() +"'><%=last_item_name%></a>");
   
        // 从后台取出子节点
        $.getJSON(
            root_url + "pages/navigation/gotoKBNavi.do?actionFlag=displayByJsonOut&d=" + (new Date()).getTime() + "&colID=<%=colID%>&" + $("#selectDictForm").serialize(),
function(data) {
if (data != null && data.result_code == "1") {
var level = parseInt(navigation_bar_list.length);
         navigation_bar_classmates[level] = data.jsonData.childNodes;
//处理正常
loadChildNodes(node, data.jsonData);
} else if (data != null && data.result_code == "2") {
//没有权限
location.href = "/support/forwardLogin.do?redirect=" + encodeURIComponent(location.href);
return false;
} else {
//处理异常
var exception = '<bean:message key="sys.err.unknowerror"/>';
$("div#navi_subnode_div").empty();
$("div#navi_subnode_div").append(exception);
return false;
}
});
       
        // 设置文档类型下拉框
        loadDocTypesFromList();
    }
  相关解决方案