Getting "oConfig.fnInit is undefined" error when trying to load table with table tools
Getting "oConfig.fnInit is undefined" error when trying to load table with table tools
cipherous
Posts: 4Questions: 0Answers: 0
Hi
It seems that in my table when I initialize the datatable with
"sDom": 'T<"clear">lfrtip'
it seems to throw ""oConfig.fnInit is undefined".
However, if I remove the "T" from the sDom parameter, the table initializes just fine. Which pretty much nullifies the usage of table tools for me. Is there something I am missing? I have sSwfPath defined and oTableTools.sSwfPath defined as well.
This is with Datatables 1.8.2 and Jquery 1.6.3
It seems that in my table when I initialize the datatable with
"sDom": 'T<"clear">lfrtip'
it seems to throw ""oConfig.fnInit is undefined".
However, if I remove the "T" from the sDom parameter, the table initializes just fine. Which pretty much nullifies the usage of table tools for me. Is there something I am missing? I have sSwfPath defined and oTableTools.sSwfPath defined as well.
This is with Datatables 1.8.2 and Jquery 1.6.3
This discussion has been closed.
Replies
it seems that TableTools.Buttons has "fnInit": null defined for the flash specific functions. Somehow, null gets translated to undefined when doing
[code]buttonDef = $.extend( {}, TableTools.BUTTONS[ buttonSet[i] ], true );[/code]
the error is throw when
[code]this._fnFlashConfig( nButton, oConfig ); [/code]
the following line fails within the method
[code]
if ( oConfig.fnInit !== null )
{
oConfig.fnInit.call( this, nButton, oConfig );
}
[/code]
oConfig.fninit is actually undefined as opposed to null.
I've just tried this on the console:
[code]
var o = { a: null };
var v = $.extend( {}, o );
[/code]
and v.a is null rather than undefined. So I'm not to sure what is happening here.
Allan
Also,
wouldn't it be better to cover both cases by doing
[code]
if (! (oConfig.fnInit)) {
}
[/code]
hmmm..according to my research, this bug with extends should've been fixed 4 years ago!
http://bugs.jquery.com/ticket/2600
It also looks like the example you provided fails on my system, so it must be the jquery lib that I am using.
thanks for your time Allan and great job with the plugin!
Allan