bootstrap菜单树

master
10295 7 years ago
parent d0b62adc54
commit ac9972184c
  1. 4
      web/src/main/webapp/WEB-INF/jsp/index.jsp
  2. 11
      web/src/main/webapp/WEB-INF/jsp/table.jsp

@ -7,7 +7,7 @@
<script> <script>
$(function () { $(function () {
$("#navSpan").click(function () { $("#menuButton").click(function () {
prefix = 'fas fa-angle-double-'; prefix = 'fas fa-angle-double-';
if ($("#navbarNavDropdown").is(":hidden")) { if ($("#navbarNavDropdown").is(":hidden")) {
$(this).find('i').attr('class', prefix + 'up'); $(this).find('i').attr('class', prefix + 'up');
@ -61,7 +61,7 @@
<div class="container-fluid"> <div class="container-fluid">
<nav class="navbar navbar-dark bg-info"> <nav class="navbar navbar-dark bg-info">
<button class="btn btn-primary col-1" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" <button class="btn btn-primary col-1" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" id="menuButton"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"> aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span id="navSpan"><b>Close</b>&nbsp;<i class="fas fa-angle-double-up"></i></span> <span id="navSpan"><b>Close</b>&nbsp;<i class="fas fa-angle-double-up"></i></span>
</button> </button>

@ -9,7 +9,7 @@
$(function () { $(function () {
$("#pageButton button").click(function () { $("#pageButton button").click(function () {
$("[name=firstResult]").val($(this).val()); $("[name=firstResult]").val($(this).val());
$('#command').submit(); $('#pageForm').submit();
}); });
}); });
</script> </script>
@ -17,6 +17,9 @@
<body> <body>
<c:choose> <c:choose>
<c:when test="${datas.type=='success'}"> <c:when test="${datas.type=='success'}">
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
@ -43,7 +46,7 @@
</tbody> </tbody>
</table> </table>
<form:form action="/data/table"> <form:form id="pageForm" action="/data/table">
<input type="hidden" name="firstResult" value="0"/> <input type="hidden" name="firstResult" value="0"/>
<input type="hidden" name="maxResults" value="${datas.pageSize}"/> <input type="hidden" name="maxResults" value="${datas.pageSize}"/>
<div class="row"> <div class="row">
@ -54,7 +57,7 @@
</p> </p>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<div id="pageButton" class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups"> <div id="pageButton" class="btn-toolbar justify-content-end" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-2" role="group"> <div class="btn-group mr-2" role="group">
<button value="0" type="button" class="btn btn-secondary">首页</button> <button value="0" type="button" class="btn btn-secondary">首页</button>
<button value="${datas.currentPage-2}" type="button" class="btn btn-secondary" <button value="${datas.currentPage-2}" type="button" class="btn btn-secondary"
@ -79,7 +82,7 @@
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<div class="alert alert-danger text-center" role="alert"> <div class="alert alert-danger text-center" role="alert">
请求数据失败 ${datas.errorMsg}
</div> </div>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>

Loading…
Cancel
Save