【JAVA学习】09.创建BootstrapTale列表页
【提要】只要JSON 返回了rows , total ,數(shù)據(jù)就會展示在列表
【步驟】
1、頁面添加Table標簽用于裝載數(shù)據(jù)
<table class="table" id="userTable">
<tr><td>請輸入查詢條件查詢</td></tr>
</table>
2、頁面初始化請求后臺數(shù)據(jù)
<script type="text/javascript">$(function(){loadTable();})function loadTable(){$('#userTable').bootstrapTable({url: '/onego/user/getUserList',method: 'get',contentType: 'application/json',dataType: 'json',pagination: true,pageSize: 10,pageList: [10,20,50,100],sidePagination: "server", //表示服務端請求 height: 500,queryParams: function(params){var temp = {pageSize: params.limit,offset: params.offset,key: ""};return temp;},columns:[{checkbox: true},{field: 'userName',title: 'userName'},{field: 'id',title: 'id'}],responseHandler: function(res){return {"total":res.total,"rows":res.rows}}});} </script>?
【問題】
1、報錯:java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.isMapLikeType()Z?
? ? ?原因:jackson-core-asl ?和 jackson-mapper-asl 兩個JAR包的版本不一致。
2、問題:后端有向前端發(fā)送正確的數(shù)據(jù),但是前端無法顯示
?原因:可能BootstrapTable未加數(shù)據(jù)請求端:sidePagination: "server", //表示服務端請求 ?
3、問題:多字段合并查詢時,查詢結果為空
? ? ?原因:CONCAT(userName,cName) like CONCAT('%',#{key},'%') ?條件時,CONCAT中的字段可以為空字符,但不能為Null
?
轉(zhuǎn)載于:https://www.cnblogs.com/pbping/p/9098301.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結
以上是生活随笔為你收集整理的【JAVA学习】09.创建BootstrapTale列表页的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 信数金服:决策模型的迭代
- 下一篇: hdata datax交流总结