fnOpen problem
fnOpen problem
Hi
I cannot insert details row, that are retrieved via an ajax call.
If I try to insert directly (for testing purposes) this also fails.
So I am not sure whether this is a bug in my implementation,
or whatever. Can anybody help me, or give any hint what's wrong ?
Regards
[code]
// 'datatables' is an array of DataTable object, as I have several independent
// tables on my page
jQuery(target+ ' table.searchable a[data-role="details"]').live('click',
function(){
var tableId = jQuery(this).parent().parent().parent().parent().attr('id')
var row = jQuery(this).parent().parent();
for( var i=0;i
I cannot insert details row, that are retrieved via an ajax call.
If I try to insert directly (for testing purposes) this also fails.
So I am not sure whether this is a bug in my implementation,
or whatever. Can anybody help me, or give any hint what's wrong ?
Regards
[code]
// 'datatables' is an array of DataTable object, as I have several independent
// tables on my page
jQuery(target+ ' table.searchable a[data-role="details"]').live('click',
function(){
var tableId = jQuery(this).parent().parent().parent().parent().attr('id')
var row = jQuery(this).parent().parent();
for( var i=0;i
This discussion has been closed.
Replies
So where the clicked element is an anchor as selected by "data-role='details'", and you want to find the row it's in, just use jQuery(this).closest('tr'). If you want to find the table's ID, jQuery(this).closest('table').attr('id').
I proved the selected row and the selected table via console.log(...) .
So every function gets it correct parameters. But I'll check that again.
Tnx so far...
I solved this issue.
If one is interested in the solution has a look at the code following.
[code]
// 'datatables' is an array of DataTable object, as I have several independent
// tables on my page
jQuery(target+ ' table.searchable a[data-role="details"]').live('click',
function(){
var tableId = jQuery(this).parent().parent().parent().parent().attr('id')
// THIS HAS BEEN THE EVIL LINE
//
// var row = jQuery(this).parent().parent();
//
// HAS TO BE
// var row = jQuery(this).parentNode.parentNode;
//
// else jQuery.inArray(nTr, nTrs) in _fnOpen() fails
// as nTr is an object, but nTrs is a plain array
var row = jQuery(this).parentNode.parentNode;
for( var i=0;i