网上扒了一个datatable的表格,但是不会用,数据源不会绑定,显示No data available in table,只有写在表格里的静态数据才有用
$('.datatable').DataTable( {
"ajax":{
"url": "http://localhost:8080/SmartOA/user/getall",
"dataSrc":"data",
},
"columns": [
{ "data": "id" },
{ "data": "name" },
{ "data": "email" },
{ "data": "islogin" },
{ "data": "createtime" },
{ "data": "status" }
]
} );
```html
<table class="datatable table table-striped" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
接口是通的,路径没问题