标签:
//通过数据字典读取select的option
<td>城市</td> <td><ef:sysDicItemList name="areaId" dictionaryCode="AREA_CODE" value="${param.areaId}" onchange="changeSelectAll()"/></td>
<td nowrap="nowrap" >厂家</td> <td><ef:sysDicItemList name="manufactuer" id="manufactuer" dictionaryCode="EMS_VENDOR" value="${param.manufactuer}" onchange="changeSelectAll()"/></td>
<td nowrap="nowrap" >名称</td> <td><input id="sourceId" style="display: none;"/> <input id="sourceName" type="text" value="" onclick="showEmsList();" > <div id="emsDiv" style="display: none; position: absolute; width: 250px; height: 200px; z-index: 9999; overflow: auto; background: #fff; border: 1px solid;"> <div class="checkAll" style="height: 20px; cursor: pointer; border: 1px solid #eef6fb;"> <input type="checkbox" class="chkBorder" value="ALL" onclick="choseAllEms();" /><a><spring:messagecode="aniam.pub.checkall" /></a></div> <c:forEach items="${ef:getAlarmSourceList(‘‘,‘‘)}" var="v" varStatus="n"> <div class="${v.areaId} vendor${v.manufactuer}" style="height: 20px; cursor: pointer; border: 1px solid #eef6fb;"> <input id="checkId" name="checkId" type=‘checkbox‘ value="${v.sourceId}" onclick="checkEms();" title="${v.sourceName}"><a>${v.sourceName}</a> </div> </c:forEach> </div> </input></td>
function changeSelectAll(){ if(jQuery("#areaId").val() == "" && jQuery("#manufactuer").val() == ""){ jQuery("#emsDiv div").show(); }else if(jQuery("#areaId").val() == "" && jQuery("#manufactuer").val() != ""){ jQuery("#emsDiv div").hide(); jQuery("."+jQuery("#checkAll").val()).show(); jQuery(".vendor"+jQuery("#manufactuer").val()).show(); }else if(jQuery("#areaId").val() != ""&& jQuery("#manufactuer").val() == ""){ jQuery("#emsDiv div").hide(); jQuery("."+jQuery("#checkAll").val()).show(); jQuery("."+jQuery("#areaId").val()).show(); }else{ jQuery("#emsDiv div").hide(); jQuery("."+jQuery("#checkAll").val()).show(); jQuery("."+jQuery("#areaId").val() + ".vendor"+jQuery("#manufactuer").val()).show(); }
标签:
原文地址:http://www.cnblogs.com/tannoy/p/4932574.html