国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

el表達式 寫入bootstrap表格數(shù)據(jù)頁面的實例代碼

2019-11-19 17:59:49
字體:
來源:轉載
供稿:網(wǎng)友

el表達式,寫入bootstrap表格,簡化代碼,效果圖:

不多說,上干貨:

<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <c:set var="ctx" value="${pageContext.request.contextPath}"/> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>知識庫</title> <link rel="stylesheet" href="<%=basePath %>knowledge-bs/css/bootstrap.min.css"> <link rel="stylesheet" href="<%=basePath %>knowledge-bs/css/bootstrap-table.min.css"> <link href="<%=basePath %>knowledge-bs/css/toastr.css" rel="stylesheet" /> <link href="<%=basePath %>knowledge-bs/css/sweetalert.css" rel="stylesheet" /> <script src="<%=basePath %>knowledge-bs/js/jquery.min.js"></script> <script src="<%=basePath %>knowledge-bs/js/sweetalert.min.js"></script> <script src="<%=basePath %>knowledge-bs/js/bootstrap.min.js"></script> <script src="<%=basePath %>knowledge-bs/js/tableExport.js"></script> <script src="<%=basePath %>knowledge-bs/js/jquery.base64.js"></script>  <script src="<%=basePath %>knowledge-bs/js/bootstrap-table.js"></script> <script src="<%=basePath %>knowledge-bs/js/bootstrap-table-export.js"></script> <script src="<%=basePath %>knowledge-bs/js/toastr.js"></script>  <style type="text/css">  #reportTableDiv td{height: 50px; text-align: center; line-height: 50px; width: auto;}  #reportTableDiv th{height: 50px; text-align: center; line-height: 50px; width: auto;} </style> </head> <body> <jsp:include page="zsfktck.jsp"></jsp:include> <center>   <div id="container" style="padding-top: 30px;padding-right: 60px;padding-left: 60px;margin-right: auto;margin-left: auto;height:auto">     <ul id="myTab" class="nav nav-tabs">       <li><a href="/receiverShow/knowledge-bs/knowledge.html#container">知識庫管理</a></li>       <li><a href="/receiverShow/findKnowRevi_el.action#container">知識庫審核</a></li>       <li><a href="/receiverShow/findAskManagement_el.action#container1">提問管理</a></li>     </ul>  <div style="padding-left: 50px;">   <table>     <thead>       <tr>           <td style="padding-left: 30px;"><label>關鍵字</label></td>           <td style="padding-left: 10px;"><input type="text" class="form-control" aria-describedby="sizing-addon2" id="keyword" value="" placeholder="請輸入關鍵字"/></td>           <td style="padding-left: 120px;"><label>標題</label></td>           <td style="padding-left: 10px;"><input type="text" class="form-control" aria-describedby="sizing-addon2" id="title" value="" placeholder="請輸入標題"/></td>           <td style="padding-left: 120px;"><label>內(nèi)容</label></td>           <td style="padding-left: 10px;"><input type="text" class="form-control" aria-describedby="sizing-addon2" id="content" value="" placeholder="請輸入內(nèi)容"/></td>       </tr>     </thead>   </table>   <div style="padding-top: 10px;">         <button id="serch" class="btn btn-info">查詢</button>         <button id="reset" class="btn btn-primy">重置</button>   </div>  </div>   <div id="reportTableDiv" class="span10">     <table class="table table-hover" id="tablepos">     <thead>       <tr>         <th>標題</th>         <th>分類</th>         <th>關鍵字</th>         <th>點擊數(shù)</th>         <th>提交時間</th>         <th>詳情</th>         <th>操作</th>       </tr>     </thead>     <tbody>       <c:forEach var="list" items="${protectLists}">       <tr>         <td>${list.title }</td>         <td>${list.classification }</td>         <td>${list.keyword }</td>         <td>${list.clicks}</td>         <td>${list.committime}</td>         <td><a data-toggle="modal" data-target="#myModal" class="details_button" name="${list.title },${list.clicks},${list.committime},${list.contentss}">詳情</a>          </td>         <td><a data-toggle="modal" data-target="#myModal" class="review_button" name="${list.title },${list.clicks},${list.committime},${list.contentss},${list.id },">審核</a>          </td>       </tr>       </c:forEach>     </tbody>     </table>   </div>  </div>   </center> </body> <script type="text/javascript">     $('#serch').click(function () {       $.ajax({         type: "POST",         url: "findKnowRevi_el.action",         success: function (data,msg) {           if(msg == "success"){           window.location.href="<%=basePath %>findKnowRevi_el.action?"+"workOrderTDTO1.keyword=" + escape($('#keyword').val()) + "&workOrderTDTO1.title=" + escape($('#title').val())+ "&workOrderTDTO1.content=" + escape($('#content').val());           }         },         error: function (XMLHttpRequest, textStatus, thrownError) {           alert('模塊加載異常!');         }       });     });     $('#reset').click(function(){       $('#keyword').val("");       $('#title').val("");       $('#content').val("");     });     $(".review_button").click(function(){       var id ;       $("#myModalLabel_content").text("知識反饋");       var str=$(this).attr("name");       strs=str.split(","); //字符分割       for (i=0;i<strs.length ;i++ ){         $("#txt_title_details").val(strs[0]);         $("#txt_clicks_details").val(strs[1]);         $("#txt_committime_details").val(strs[2]);         $("#txt_content_details_sub").val(strs[3]);         id =strs[4];       };       $('#myModal_content').modal();       $("#button_sub").removeClass("hidden");       $("#button_sub").addClass("modal-footer");       $("#btn_submit_content").click(function(){            $.ajax({               type: "POST",               url: "agreeExamine.action",               data: "knowledge.id=" +id,               success: function (data,msg) {                 if(msg == "success"){                   $('#myModal_content').modal('hide');                   window.location.href="<%=basePath %>findKnowRevi_el.action";                   toastr.success('審核成功');                 }               },               error: function (XMLHttpRequest, textStatus, thrownError) {                 alert('模塊加載異常!');               }             });       });       $("#btn_refuse").click(function(){          $.ajax({             type: "POST",             url: "deleteKnowExamine.action",             data: "id=" +id,             success: function (data,msg) {               if(msg == "success"){                 $('#myModal_content').modal('hide');                 window.location.href="<%=basePath %>findKnowRevi_el.action";                 toastr.success('拒絕通過');               }             },             error: function (XMLHttpRequest, textStatus, thrownError) {               alert('模塊加載異常!');             }           });   });     });     $(".details_button").click(function(){       var str=$(this).attr("name");       strs=str.split(","); //字符分割       for (i=0;i<strs.length ;i++ ){         $("#txt_title_details").val(strs[0]);         $("#txt_clicks_details").val(strs[1]);         $("#txt_committime_details").val(strs[2]);         $("#txt_content_details_sub").val(strs[3]);       };       $("#myModalLabel_content").text("");       $('#myModal_content').modal();       $("#button_sub").addClass("hidden");     }); </script> </html> 

以上所述是小編給大家介紹的el表達式 寫入bootstrap表格數(shù)據(jù)頁面的實例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網(wǎng)網(wǎng)站的支持!

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 刚察县| 西充县| 上饶市| 玉山县| 丰台区| 马龙县| 含山县| 贵定县| 庆云县| 佛山市| 三原县| 汉阴县| 云南省| 漯河市| 镇江市| 耿马| 永平县| 江永县| 都昌县| 冀州市| 汉中市| 赣州市| 定边县| 河津市| 保定市| 开平市| 淳化县| 高平市| 石台县| 汶上县| 嘉黎县| 越西县| 贡山| 灵石县| 卢龙县| 东辽县| 页游| 贡觉县| 屏南县| 曲麻莱县| 肥乡县|