zoukankan      html  css  js  c++  java
  • 每日记载内容总结2

    1.部分css内容

    border-collapse:collapse
    border-collapse 属性设置表格的边框是否被合并为一个单一的边框
    colspan  colspan 属性规定单元格可横跨的列数。
    

     2.jsp里面加入java代码实现select的option

    <select name="bookTypeId">
    <%
      List<BookType> bookType=(List<BookType>)request.getAttribute("bookType");
      for(BookType bookType : bookTypes) {
    %>
      <option values="<%=bookType.getBokkTypeId()%>"><%=bookType.getBookTypeId()%></option>
    <%}%>
    </select>
    

     3.根据java传值判断checkbox是否选中

    var displayPrice=$("#displayPrice").attr("value");
    		if(displayPrice=="Y"){
    			$("#displayPrice").attr("checked",true);
    			}else{
    				$("#displayPrice").attr("checked","");
    				}
    

     4.select判断传入值并设置默认值

     <select name="condition" id="condition">
    	<option value="1" ${productBean.condition== "1" ? 'selected' : '' }>NEW</option>
    	<option value="2"  ${productBean.condition== "2" ? 'selected' : ''}>USED</option>
     </select>
    

     5.在select中用foreach接受传入的list并设置默认值

    <select class="manufac" name="manufName"  id="manufName">
    		<c:forEach items="${manufacturers}" var="manuf" varStatus="status">
    				<option value="${manuf.manufacturerId}" ${productBean.manufacturerId eq manuf.manufacturerId ? "selected='selected'" : ""}>
                                ${manuf.manufacturerName}</option>
    		</c:forEach>
    </select>                
    
  • 相关阅读:
    js 中的 EventLoop
    线程的并发工具类
    xpath获取某个节点下的全部字节点的文本
    2020中国 .NET开发者大会精彩回顾:葡萄城高性能表格技术解读
    .NET 控件集 ComponentOne V2020.0 Update3 发布,正式支持 .NET 5
    log4net配置
    TP5.1 爬虫
    pip下载慢
    TP5.1 二维码生成
    composer插件集合
  • 原文地址:https://www.cnblogs.com/cuiyf/p/2917329.html
Copyright © 2011-2022 走看看