Bootgrid为表中的每个数据生成0

时间:2015-01-04 08:30:41

标签: javascript jquery datagrid twitter-bootstrap-3

我在使用datatables渲染表时出现问题,因此我在网站上使用了bootgrid。 Bootgrid很好地渲染表格。该表与它成为一个数据网格,而不像我在上一个问题中提到的数据表那样。但是在bootgrid渲染表后,所有值都变为0。这是为什么 ?有没有解决方法来解决这个问题?

我刚刚使用了这段代码



$( document ).ready(function() {
        $('#data_table').bootgrid();
    });  




我用这个

引用了JQuery



<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>    
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

如果要使用提供给它的数据加载bootgrid,则必须添加&#34; data-column-id&#34;属性为列。

例如:对于列Sender,表结构应如下所示:

<table id="data_table">
<thead><tr>
<th data-column-id="sender">Sender</th>
</tr>
</thead>
</table>