fnOpen throwing error!
fnOpen throwing error!
Hello dataTables community!
So I have a page where single or multiple dataTables are being called in via AJAX.
On page load, when a single table is called in, the fnOpen function works like a charm displaying the duplicate articles below the row when the "+" sign is clicked.
However, on page load when 2 or more tables are called in the fnOpen function does not work and throws this error:
b.aoData[a] is undefined
This also occurs when loading a table via AJAX without a page refresh by using a select dropdown menu.
Here is the code that I am using for the link:
[code]
$('#table_container .dup_toggle').live('click', function () {
var nTr = this.parentNode.parentNode.parentNode;
var docId = $(this).attr('id');
$(this).toggleClass('active');
if (!$(this).hasClass('active') ){
agentTable.fnClose( nTr );
} else {
agentTable.fnOpen( nTr, mw.mnews.agents.getDuplicates(data, tableId, agentTable, nTr, docId, agentId), 'duplicates' );
}
});
[/code]
So I have a page where single or multiple dataTables are being called in via AJAX.
On page load, when a single table is called in, the fnOpen function works like a charm displaying the duplicate articles below the row when the "+" sign is clicked.
However, on page load when 2 or more tables are called in the fnOpen function does not work and throws this error:
b.aoData[a] is undefined
This also occurs when loading a table via AJAX without a page refresh by using a select dropdown menu.
Here is the code that I am using for the link:
[code]
$('#table_container .dup_toggle').live('click', function () {
var nTr = this.parentNode.parentNode.parentNode;
var docId = $(this).attr('id');
$(this).toggleClass('active');
if (!$(this).hasClass('active') ){
agentTable.fnClose( nTr );
} else {
agentTable.fnOpen( nTr, mw.mnews.agents.getDuplicates(data, tableId, agentTable, nTr, docId, agentId), 'duplicates' );
}
});
[/code]
This discussion has been closed.
Replies
Allan
Thanks for the reply mate :)
I don't have a link that I can provide we are in mid-development on a SAAS application.
The weird thing is that it works when called in via AJAX on page load and there is only one table...when there is multiple tables it doesn't...
I will have another pair of eyes look at it here for me and get back to you on the results :)
Thanks again bro!
Brad
Allan
Brad
Allan
I am using DT version 1.7.6
The error given is:
s is null
jquery.datatables-1.7.6.js
Line 5169
Any ideas?
Thanks for all the help. Donations coming amigo!
Brad
Thanks!
Sorry for the delayed reply. Paid support is done by the 'Support' button at the top of this page. If you make a donation (rather than a support package - which might come soon!) and enter the thread number, it allows me to track which threads get priority :-)
So 's' in this case is the settings object for the DataTable. The fact that it is null is bad since it means that DataTables doesn't know what is going on basically (there are no settings for it to operate on!). That would suggest to me that either 'agentTable' has changed, or the iApiIndex property of DataTables has been changed.
Could you show me how you initialise agentTable and the second table?
Thanks,
Allan
Thanks for all the help! I figured it out. I was using the .live function and changed it to .bind and everything is working now : )
Brad