##json数据:
[
{
"category": "代查",
"transactionNum": "531300T10014187",
"literatureName": "浅析孔子的做人之道及其现实意义--读《论语》有感",
"commitTime": "2016-01-21 10:47:48",
"status":"待领取",
"userInfo":"610319645",
"userInstitution":"XX大学"
}, {
"category": "代查",
"transactionNum": "531300T10014187",
"literatureName": "浅析孔子的做人之道及其现实意义--读《论语》有感",
"commitTime": "2016-01-21 10:47:48",
"status":"待领取",
"userInfo":"610319645",
"userInstitution":"XX大学"
}, {
"category": "代查",
"transactionNum": "531300T10014187",
"literatureName": "浅析孔子的做人之道及其现实意义--读《论语》有感",
"commitTime": "2016-01-21 10:47:48",
"status":"待领取",
"userInfo":"610319645",
"userInstitution":"XX大学"
},{
"category": "代查",
"transactionNum": "531300T10014187",
"literatureName": "浅析孔子的做人之道及其现实意义--读《论语》有感",
"commitTime": "2016-01-21 10:47:48",
"status":"待领取",
"userInfo":"610319645",
"userInstitution":"XX大学"
}
]
问题:如何用AdminLTE相关技术(js等)展示json数据到表格?表格如下图:
表格html如下:
<div class="box-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>序号</th>
<th>类别</th>
<th>事务号</th>
<th>文献名称</th>
<th>提交时间</th>
<th>状态</th>
<th>用户信息</th>
<th>用户机构</th>
<th>操作</th>
</tr>
</thead>
<tbody id="list">
</tbody>
<tfoot>
<tr>
<th>序号</th>
<th>类别</th>
<th>事务号</th>
<th>文献名称</th>
<th>提交时间</th>
<th>状态</th>
<th>用户信息</th>
<th>用户机构</th>
<th>操作</th>
</tr>
</tfoot>
</table>
</div>
自己试着写了js,但是不对,如何改进?js如下:
$('#example2').dataTable( {
"ajax": {
"url": "./json/receiveBookInf.json",
"type": "POST"
},
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );