日期:2014-05-16  浏览次数:20407 次

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);
    }
   
    // 设置文档类型下拉框
    fu