Issue with own JQuery code
Issue with own JQuery code
I'm using Datatables for my own stuff but I have a little issue with pagination and my own JQuery code usage.
What's going on?
I have a <td> that is like this:
<a class="playBtn" data-md5="'.$row['md5_file'].'" data-name="'.$row["filename"].'" data-id="'.$row["ID"].'" data-fileformat="'.$row["fileformat"].'" title="Play"><img src="modules/Music/images/play.png" width="15" height="15"></a>
So I have a JQuery function like this:
$("a.playBtn").click(function(){....
The thing is, it works perfectly on the first page of the pagination but not on the rest.
Any solution?
This question has an accepted answers - jump to answer
Answers
Is this
in
fnDrawCallback
function ?If you use server-side you have to bound events to newly created objects, which are rendered by DataTables. The fnDrawCallback should help doing that.
Merci, solved.
But quite a mess that I have to paste like 3-4 long functions in the same file :[