首页 > 解决方案 > 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>

标签: ajax

解决方案


推荐阅读