fnOpen and fnAdd in fnRowCallback not working
fnOpen and fnAdd in fnRowCallback not working
Hi,
I am creating a hierarchical table. I am doing this by creating an outer datatable and then on items that have children adding a new datatable that contains the child data. All of this is done with client side data, there is no server side processing.
I am having an issue with fnOpen and fnAdd failing if I add the child table and populate it's data in the fnRowCallback event. But, fnOpen and fnAdd work fine in a button event after the outer datatable is created. The problem appears to be that fnAdd fails because in the code below "this[DataTable.ext.iApiIndex]" is undefined. (DataTable.ext.iApiIndex=0).
[code]
this.fnAddData = function( mData, bRedraw )
{
if ( mData.length === 0 )
{
return [];
}
var aiReturn = [];
var iTest;
/* Find settings from table node */
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
[/code]
Looking further it looks like a number are undefined on the nRow object such as the parentNode, siblings, etc. I am wondering how much of the datatable is in place when fnRowCallback is called?
I am creating a hierarchical table. I am doing this by creating an outer datatable and then on items that have children adding a new datatable that contains the child data. All of this is done with client side data, there is no server side processing.
I am having an issue with fnOpen and fnAdd failing if I add the child table and populate it's data in the fnRowCallback event. But, fnOpen and fnAdd work fine in a button event after the outer datatable is created. The problem appears to be that fnAdd fails because in the code below "this[DataTable.ext.iApiIndex]" is undefined. (DataTable.ext.iApiIndex=0).
[code]
this.fnAddData = function( mData, bRedraw )
{
if ( mData.length === 0 )
{
return [];
}
var aiReturn = [];
var iTest;
/* Find settings from table node */
var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
[/code]
Looking further it looks like a number are undefined on the nRow object such as the parentNode, siblings, etc. I am wondering how much of the datatable is in place when fnRowCallback is called?
This discussion has been closed.
Replies
> I am wondering how much of the datatable is in place when fnRowCallback is called?
None. The table is still to redraw at that point, so the DOM is not up to date.
Allan