获取所有已过滤的数据表行以使用jQuery进行迭代

时间:2013-04-24 10:52:59

标签: jquery

我正在使用

在dataTable中为过滤行应用css类
 tableName.fnFilter( this.value, 0);
$(tableName.fnGetNodes()).addClass('diffColor');

但我需要迭代数据表中所有已过滤的行。这是可能的。我怎么能这样做。   提前谢谢......

1 个答案:

答案 0 :(得分:0)

May be its helpful for you 

var oTable = $("#Mytable").dataTable({whatever discribing your datatable});
//After the declaration of your datatable : 

var rowToAdd = true;
oTable.$('tr').each(function(){
var td_index = 0;
$(this).children('td').each(function){
 if($(this).value == mynewdata[td_index])
    rowToAdd = false;
 td_index++;
}
});
if(rowToAdd)
    oTable.fnAddData([Name,Age,Link,Schema,Visite,Info]);
相关问题