jQuery load and Datatables fnDrawCallback
jQuery load and Datatables fnDrawCallback
GameCharmer
Posts: 3Questions: 0Answers: 0
I have recently ran into a strange instance when using callbacks on a loaded datatables table.
I have a div on my main page that, based on a selection, will load another page containing a table set up like the table in this URL
http://datatables.net/examples/advanced_init/row_grouping.html
To make a long story short, I am doing the following.
[code]
HideContent();
$('#MyDiv').load('tablepage.php', {'t', '123'}, function(){ ShowContent(); });
[/code]
HideContent and ShowContent are small functions that hide one div, show another, and change the class of the nav bar.
When fnDrawCallback fires, it stops jQuery Load. My quick fix for this was to add ShowContent(); in the fnDrawCallback area, but it took me the better part of an hour messing around before I figured it out.
Is this a desired effect, or is this a limitation/bug of jQuery or DataTables?
I have a div on my main page that, based on a selection, will load another page containing a table set up like the table in this URL
http://datatables.net/examples/advanced_init/row_grouping.html
To make a long story short, I am doing the following.
[code]
HideContent();
$('#MyDiv').load('tablepage.php', {'t', '123'}, function(){ ShowContent(); });
[/code]
HideContent and ShowContent are small functions that hide one div, show another, and change the class of the nav bar.
When fnDrawCallback fires, it stops jQuery Load. My quick fix for this was to add ShowContent(); in the fnDrawCallback area, but it took me the better part of an hour messing around before I figured it out.
Is this a desired effect, or is this a limitation/bug of jQuery or DataTables?
This discussion has been closed.
Replies
Allan
Do you know of any debug info scripts that would work for tracking this down.
Allan
I changed
[code]
HideContent();
$('#MyDiv').load('tablepage.php', {'t', '123'}, function(){ ShowContent(); });
[/code]
To
[code]
$('#MyDiv').html('LOADING');
$('#MyDiv').load('tablepage.php', {'t', '123'});
[/code]
Works great!
Anyway, keep up the awesome work with data tables. I can't wait for 1.8! :)