【发布时间】:2016-12-10 11:23:03
【问题描述】:
有人可以解释如何为数据单元格添加工具提示,其中包含从 ajax 请求返回的数据。
我在文档中找不到任何内容:
http://bootstrap-table.wenzhixin.net.cn/documentation/
我知道如何通过 HTML 标记在循环中填充数据来实现这一点,但是当数据从 ajax 请求返回时自动填充时,似乎没有一种简单的方法可以做到这一点。
这就是我的桌子的设置方式:
<table id="stockLineTable" class="table table-bordered table-condensed table-striped" data-toggle="table" data-classes="" data-toolbar="#filter-bar"
data-search="true"
data-show-refresh="true"
data-show-columns="true"
data-minimum-count-columns="2"
data-pagination="true"
data-page-list="[25, 50, 100, 200]"
data-show-footer="true"
data-show-export="true"
data-show-filter="true"
data-click-to-select="true"
data-page-size="25"
data-export-types="['csv', 'doc', 'excel']" style="display: none;"
data-url="/Api/StockLine/GetStockLines"
data-side-pagination="server"
data-query-params-type=""
data-sort-order="desc"
data-row-style="rowStyle"
data-query-params="queryParams">
<thead>
<tr>
<th data-field="state" data-radio="true"></th>
<th data-sortable="true" data-field="RowIndex" data-visible="false" data-switchable="false"></th>
<th data-sortable="true" data-field="StockDetailID" data-visible="true" data-switchable="true">@Resource.ID</th>
<th data-sortable="true" data-visible="true" data-switchable="true" data-field="Name">@Resource.Stock @Resource.Line</th>
<th data-sortable="true" data-field="Size" data-switchable="true" data-visible="true">@Resource.Size</th>
<th data-sortable="true" data-field="StockCategoryID" data-switchable="true" data-visible="true">@Resource.Category</th>
<th data-sortable="true" data-field="StockLevel" data-sorter="dateSorter">@Resource.Qty @Resource.InStock</th>
<th data-sortable="true" data-field="MinQuantityLevel">@Resource.Qty @Resource.OnOrder</th>
<th data-sortable="false" data-field="Controls" data-switchable="false" data-visible="true"></th>
<th data-sortable="false" data-field="AdHoc" data-switchable="false" data-visible="false"></th>
</tr>
</thead>
</table>
【问题讨论】:
-
在哪里需要基于 ajax 的工具提示?您需要哪个活动?
-
我需要在行中包含的数据中使用它,我知道可以在标题中执行,但数据行似乎没有任何内容
标签: javascript html ajax twitter-bootstrap bootstrap-table