小编amu*_*l98的帖子

无法使用Ajax调用更新DataTable主体

我有一个DataTable,我正在尝试通过ajax调用来加载数据,但是数据的第一行总是说:

“表中没有可用数据” 在此处输入图片说明

但是在它下面包含了已加载的ajax数据。如何删除No数据行并将ajax数据加载到该位置?

下面的代码:

<div class="box-body">
  <table id="changeTicketsTable" class="table table-bordered table-striped">
    <thead>
      <tr>
        <th>Ticket Number</th>
        <th>Description</th>
        <th>Risk</th>
        <th>Primary CI</th>
        <th>State</th>
        <th>Planned Start Date</th>
        <th>Actual Start Date</th>
        <th>Actual End Date</th>
        <th>Affected Partners</th>
      </tr>
    </thead>
    <tbody>  

    </tbody>
    <tfoot>
      <tr>
        <th>Ticket Number</th>
        <th>Description</th>
        <th>Risk</th>
        <th>Primary CI</th>
        <th>State</th>
        <th>Planned Start Date</th>
        <th>Actual Start Date</th>
        <th>Actual End Date</th>
        <th>Affected Partners</th>
      </tr>
    </tfoot>
  </table>
</div>
Run Code Online (Sandbox Code Playgroud)

数据表的实现:

<script>
    getChangeTicketInformation();
    $('#changeTicketsTable').DataTable({
      "pageLength": 5,
      'paging'      : true,
      'lengthChange': true,
      'searching'   : false,
      'ordering'    : true,
      'info'        : true,
      'autoWidth' …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery datatables

5
推荐指数
1
解决办法
65
查看次数

ChartJS - 水平堆叠条形图工具提示被画布底部切断

我试图在水平堆叠条形图的工具提示中添加多行,但最后几行被图表画布的末尾切断。是否可以使工具提示延伸到图表画布的末端?

在此输入图像描述

tooltips: {
 mode: 'nearest',
 intersect: true,
   callbacks: {
     footer: function() {
      var withBreaks = "Hello World. \n My name is Jennifer. \n What is your name?"
       return withBreaks;
     },
  }
},
Run Code Online (Sandbox Code Playgroud)

javascript chart.js

0
推荐指数
1
解决办法
2420
查看次数

标签 统计

javascript ×2

ajax ×1

chart.js ×1

datatables ×1

jquery ×1