fnRowCallback with jQuery hover
fnRowCallback with jQuery hover
[code]
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$(nRow).attr('id', 'row_' + aData[8]);
$(nRow).hover(function(){
$(this).find("td:first").append("Edit")
},function(){
$(this).find("td:first").children("div").remove();
});
}
[/code]
That's how my code looks like, I want to append Edit button to my table.
The problem I can't solve is when I goingo to another page and coming back.
On every new <> it appends one more edit button.
for example, when it loads it works okay. I go to second page, it works there as expected. now I go back to first page, it appends two edit divs. same on second page. and like this on and on, it just adds more and more divs after every redirect.
Even If I don't go to another page and just click on the same page (the disabled button) it still adds more divs.
Little information: I'm using dataTables with bootstrap and I load data with javascript array
http://live.datatables.net/edudib/2/edit#javascript
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$(nRow).attr('id', 'row_' + aData[8]);
$(nRow).hover(function(){
$(this).find("td:first").append("Edit")
},function(){
$(this).find("td:first").children("div").remove();
});
}
[/code]
That's how my code looks like, I want to append Edit button to my table.
The problem I can't solve is when I goingo to another page and coming back.
On every new <> it appends one more edit button.
for example, when it loads it works okay. I go to second page, it works there as expected. now I go back to first page, it appends two edit divs. same on second page. and like this on and on, it just adds more and more divs after every redirect.
Even If I don't go to another page and just click on the same page (the disabled button) it still adds more divs.
Little information: I'm using dataTables with bootstrap and I load data with javascript array
http://live.datatables.net/edudib/2/edit#javascript
This discussion has been closed.