0
을 사용하여 행 위치 가져 오기이 테이블을 Jquery Plugin Datatable (http://datatables.net)로 생성했습니다. 내가하고 싶은 일은 내가 만든 것이 아니라면 데이터를 통해 행이 실제로 존재 하는지를 찾는 것입니다.데이터 (Datatable Jquery)
$("#Mytable").dataTable().fnAddData([
Name,
Age,
Link,
Schema,
Visite,
Info
]);
그러나 나는 그것의 요소 또는 무엇 <td>
태그 포함을 사용하여 행을 찾는 방법에 대한 정보를 얻을하지 않았다 : 나는 행을 추가하는 방법을 찾을 수 있었다.
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]);
편집 정의 : 새 행 임니다 - 또는 추가해야하는 경우
'이 행의 모든 tds가 내가 추가하려는 행과 일치합니다. ' 정확히 내가 무엇을 찾을 필요가 !! –