ajax - bootstrap-table --> Ajax ajaxRequest 的数据
问题描述
我想使用引导表库https://examples.bootstrap-table.com/index.html#options/table-ajax.html#view-source。
我希望通过 ajax 为表提供数据。
我有这个代码:
<table id="table" class="table text-center"
data-toggle="table"
data-ajax="ajaxRequest"
data-search="true"
data-show-refresh= "true"
data-show-export="true"
data-side-pagination="server"
data-pagination="true">
<thead>
<tr>
<th data-field="ID_Persona" >Responsable</th>
<th data-field="Nombre" >Sección</th>
<th data-field="ID_Responsable" >Prog.</th>
<th data-field="Responsable" >Realizado</th>
<th data-field="Prog" >%</th>
</tr>
</thead>
</table>
脚本
<script>
function ajaxRequest(params) {
$.ajax({
url: "nombre_api",
type: "POST",
dataType: "json",
success: function(result){
console.log('ajax.success: ', result);
params.success({
});
},
error: function(er){
console.log(er)
}
});}</script>
解决方案
推荐阅读
- php - 与 $request->viaResource 一起使用时,Laravel Nova BelongsTo 字段有错误
- java - 如果文件没有完全在最后一个字节结束会发生什么?
- reactjs - 使主题在 HOC 组件中可用
- python - TypeError: 'open' 对象不支持索引,但仍然可以迭代。如何获得 Open 对象的前 n 个结果?
- google-sheets - 如何使用 Google 表格公式将数据矩阵转换为关系表?
- r - 通过移动行对数据框的行进行排序,使最大值位于顶部
- javascript - 如何保存内部范围变量以与外部范围一起使用?
- push-notification - 如何在 SQS 中空白并阅读完整的 AnyOfferChangeNotification?
- excel - Excel 条件格式 - 突出显示从今天开始的日期范围
- git - 如何恢复中止的变基