Jquery code AFTER datable has loaded
Jquery code AFTER datable has loaded
iloop
Posts: 2Questions: 0Answers: 0
Hello,
I have HREF in my datable that targets a jQuery click code at the bottom of my page.
The problem is that it has no effect because i think it must wait datatabla has loaded, is there a event for that ?
thanks
$(document).ready(function() {
var frameSrc = "";
$('a[href="#modalsm"]').click(function(){
$frameSrc = $(this).data( "src" );
$('#myModalsm iframe').attr("src",$frameSrc);
});
This discussion has been closed.
Replies
Hi @iloop ,
I'm not seeing where the DataTable is being initialised, so it's hard to say. However, you could but the click code in
initComplete
, which would mean it's called after the table is fully initialised.Cheers,
Colin
the datable is initialized up in the body and this code is at the bottom.
I tried with initComplete but it did not worked ...
thanks
cheers
Sounds like you might have two
$(document).ready
blocks - couldn't you just move the DataTables into the one you're pasting.If that doesn't work, we're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin