DataTables:TypeError:我是未定义的 [英] DataTables: TypeError: i is undefined

查看:346
本文介绍了DataTables:TypeError:我是未定义的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张如下表格:



表格为rowspans,因为对于某些用户,我需要2行(就像你在'D'列看到的那样)

我试图使用数据表:

 < table class =table table-bordered table-hover table-stripedid =myTable> 
(...)
< / table>

我在代码开始时调用它:

 < script> 
$(document).ready(function(){
$('#myTable')。DataTable();
});
< / script>

但我有这个错误:


TypeError:i未定义


表格不像数据表类型!



也许它不适用于rowspans?
任何想法

解决方案

jQuery DataTables插件不支持 ROWSPAN 属性。然而,jQuery DataTables有一个 RowsGroup 插件,它们将单元格分组在一起,使它们看起来像是使用ROWSPAN 属性。



请参阅这个例子用于代码和演示。

请参阅 jQuery DataTables - RODSPAN在表体TBODY 获取更多详细信息。


I have a table like the following

the table as rowspans because for some users I need to have 2 lines (Like you see at column 'D')

I am trying to use datatables:

<table class="table table-bordered table-hover table-striped" id="myTable">
(...)
</table>

And I call this at the begining of the code:

 <script>
    $( document ).ready(function() {
         $('#myTable').DataTable();
    });
</script>

But I have this error:

TypeError: i is undefined

And the table is not like a datatable type!

Maybe it doesn't work with rowspans? Any idea??

解决方案

jQuery DataTables plug-in doesn't support ROWSPAN attribute by default. However there is a RowsGroup plugin for jQuery DataTables that groups cells together to make them look like as if ROWSPAN attribute is used.

See this example for code and demonstration.

See jQuery DataTables – ROWSPAN in table body TBODY for more details.

这篇关于DataTables:TypeError:我是未定义的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆