rows().columns().nodes().flatten().to$()
rows().columns().nodes().flatten().to$()
zapata
Posts: 13Questions: 5Answers: 1
snc.a[s] contains title of TD. But I cant add each of title to each of 7th TD. BUT 7th TD always get value of last snc.a[s]
var newTable=$('#musteri_ara_table').DataTable({"bFilter" : false,"bLengthChange": false});$.ajax({
type:"POST",
url:"myUrl",
data:"myData",
dataType:"json",
success:function(snc){
for(s=0; s< snc.a.length; s++){
nod= newTable.row.add( [s+1,snc.a[s]]).draw();nod.rows(s).columns(6).nodes().flatten().to$().attr("title",s);}}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Can you link to a test page showing the issue, as per the forum rules, please.
Thanks,
Allan
http://www.resge.com/test/dTable.php
As you will see, second column is red and its title is not that I want(Column Title has to be which artist's last name at each row). All second columns title is The last data Magic Johnson's last name.
You need to use an iterator - at the moment you have the code setting the title attribute for all of the cells in column 1, and the last one will "win".
I would suggest using
rows().every()
:You will need to updated to 1.10.6 to use
rows().every()
.Allan
$( nod.cell(s,1).node() ) .attr("title",snc.lname[s]);
that is ok. thanks!