fnReloadAjax plugin function appears to bypasses fnInfoCallback
fnReloadAjax plugin function appears to bypasses fnInfoCallback
I am using fnInfoCallback to add 'x rows selected' to the info. this is all working fine except for tables which are using an ajax source. The table renders correctly at initialization, calling my callback function, however when I call fnReloadAjax it appears to bypass the fnInfoCallback.
I've setup a test case here, although it's not really a true case because I couldn't get the ajax source to work. There should be 2 alerts, one for the initialization and one after calling fnReloadAjax.
http://live.datatables.net/uvadup/6/edit#javascript,html,live
any help much appreciated :)
I've setup a test case here, although it's not really a true case because I couldn't get the ajax source to work. There should be 2 alerts, one for the initialization and one after calling fnReloadAjax.
http://live.datatables.net/uvadup/6/edit#javascript,html,live
any help much appreciated :)
This discussion has been closed.
Replies
Allan
The way I am saving and getting the TableTools object is saving it using $.data() and then retrieving like this:-
[code]
var oTableTools = $('#' + id).data('oTableTools');
[/code]
Where id is the css id of the table. This works well except after calling fnReloadAjax(); - the TableTools object is undefined, as if the DOM for the actual element is reloaded, wiping the data that jquery has attached to it with $.data()?
I have tried using TableTools.fnGetInstance(id); instead but this returns null and fnGetMasters returns an empty object. This is on first initialization, it doesn't even get as far as fnReloadAjax.
I imagine there is probably some issue with the method I am using to initialize DT, so it's probably not possible to say what the issue is without seeing some more code, it's clearly not a problem with DT or TT. But any pointers you might have would be very much appreciated.
I'm afraid I'd be reduced to adding code to debug that one, as I don't know what would be causing the issue.
I think longer term I need a better way of getting the plug-in instances from the DataTables instance. I'll look into that!
Regards,
Allan
Anyway, I'll have another look at it tomorrow and see if I can work out what's going on. If not I'll drop you an email - not much point in clogging up the forum with something that is almost certainly going to be specific to my exact case!
thanks!
Rob.
Again with my long term plans for DataTables :-)
Allan