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

    // 设置文档类型下拉框
    function loadDocTypesFromList() {
       
        var select = $("<select id='selectDocType' onchange='selectDocTypeChange(this)' style='width:200px; vertical-align:middle;'></select>");
        var hasDefault = false;
        <%
        List docTypeList = (List) request.getAttribute("doc_type_list");
        if (docTypeList != null && docTypeList.size() > 0) {
            for (int i = 0; i < docTypeList.size(); i++) {
                Map item = (Map) docTypeList.get(i);
        %>
            var name = "<%=item.get("MATERIAL_TYPE_NAME")%>"
            if ("ProductManual" == "<%=item.get("MATERIAL_TYPE")%>") {
            name = name + "-<bean:message key='support.navigate.doc.type.all'/>";
            }
            var option = "";
            if (selected_doc_type == "<%=item.get("MATERIAL_TYPE")%>") {
                option = $("<option value='<%=item.get("MATERIAL_TYPE")%>' selected>" + name + "(<%=item.get("DOC_COUNT")%>)</option>");
                hasDefault = true;
            } else {
                option = $("<option value='<%=item.get("MATERIAL_TYPE")%>'><%=item.get("MATERIAL_TYPE_NAME")%>(<%=item.get("DOC_COUNT")%>)</option>");
            }
            select.append(option);
        <%
            }
        }
        %>
           
        if (hasDefault == true) {
            select.append("<option value=''>" + "<bean:message key='support.navigate.doc.type.all'/>" + "</option>");
        } else {
            select.append("<option value='' selected>" + "<bean:message key='support.navigate.doc.type.all'/>" + "</option>");
        }
       
        $("#navi_select_doctype_div").empty();
        $("#navi_select_doctype_div").append("<bean:message key='support.navigate.select.doc.type'/>");
        $("#navi_select_doctype_div").append(select);
    }
   
    // 设置文档类型下拉框
    function loadDocTypes(curLevel, docTypeList) {
   
        $("#navi_select_doctype_div").empty();
        if (curLevel > 1) {
            if (docTypeList == null) {
                return false;
            }
           
            var select = $("<select id='selectDocType' onchange='selectDocTypeChange(this)' style='width:200px; vertical-align:middle;'></select>");
            var hasDefault = false;
            for (var i = 0; i < docTypeList.length; i++) {
            var name = docTypeList[i].MATERIAL_TYPE_NAME;
            if ("ProductManual" == docTypeList[i].MATERIAL_TYPE) {
            name = name + "-<bean:message key='support.navigate.doc.type.all'/>";
            }
                var option = "";
                if (selected_doc_type == docTypeList[i].MATERIAL_TYPE) {
                    option = $("<option value='" + docTypeList[i].MATERIAL_TYPE + "' selected></option>");
                    hasDefault = true;
                } else {
                    option = $("<option value='" + docTypeList[i].MATERIAL_TYPE + "'></option>");
                }
                $(option).append(name + "(" + docTypeList[i].DOC_COUNT + ")");
               
                select.append(option);
            }
           
            if (hasDefault == true) {
                select.append("<option value=''>" + "<bean:message key='support.navigate.doc.type.all'/>" + "</option>");
            } else {
                select.append("<option value='' selected>" + "<bean:message key='support.navigate.doc.type.all'/>" + "</option>");
            }
           
            $("#navi_select_doctype_div").append("<bean:message key='support.navigate.select.doc.type'/>");
            $("#navi_select_doctype_div").append(select);
        }
    }

你可能感兴趣的:(jquery,jsp)