[英]Reload bootstrap table Refresh and change settings
我目前正在尝试根据存储在localStorage中的一些用户配置动态地更改引导表的配置,然后重新加载它。
该表会在页面加载时填充,但是某些事件可能会在页面内触发并根据用户设置更改其配置。
我看了一下官方文档以及SO中的一些 问题 。 我尝试这样做,如下所示:
var $table = $('#grd-fatura');
$table.bootstrapTable('refresh', {
pageSize: 2
});
(出于测试目的,已从上述代码中删除了localstorage.getItem块和规则。)
这是我的表代码(请注意,某些元素是葡萄牙语):
<table
id="grd-fatura" data-click-to-select="true" data-response-handler="responseHandler"
data-pagination="true" @*data-height="460"*@ data-show-footer="true" data-search="true"
data-show-columns="true" data-cache="false" data-show-toggle="true" data-show-export="true">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="ID" data-unique-id="ID" data-align="left" data-visible="false" data-sortable="true">Código</th>
<th data-field="estabelecimento" data-align="left" data-sortable="true">Estabelecimento</th>
<th data-field="historico" data-align="left" data-sortable="true">Histórico</th>
<th data-field="tipo" data-align="left" data-sortable="true">Tipo</th>
<th data-field="pessoa" data-align="left" data-sortable="true">Pessoa</th>
<th data-field="emissao" data-align="center" data-sortable="true">Emissão</th>
<th data-field="referencia" data-align="left" data-sortable="true">Referência</th>
<th data-field="situacao" data-align="left" data-sortable="true">Situação</th>
<th data-field="total" data-align="right" data-sortable="true" data-footer-formatter="Totalizador">Total</th>
</tr>
</thead>
</table>
该代码不起作用。 该表不会刷新,并且代码不会产生任何错误。 我看了一些示例 ,但找不到我要去哪里。 那么,如何动态更改Boostrap表设置? 我在上面的代码中做错了什么?
注意:我正在使用Bootstrap 3 。
尝试这个:
$table.bootstrapTable('refresh', {
query: {pageSize: 2}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.