DataTables in Adobe AIR
DataTables in Adobe AIR
I'm trying to use DataTables in Adobe AIR. I'm using AIR's HTMLLoaders to create multiple windows and my table that I'm trying to use DataTables on is in one of those windows. When DataTables references the document for creating elements in AIR, I believe it refers to the application's main window and not the "document" or window the table is in. I believe this is causing AIR to throw the following error WRONG_DOCUMENT_ERR: DOM Exception 4 on line 2226 of DataTables 1.5.0 beta 7 when I attempt to use it. I'm in a bit of a bind and would prefer to use DataTables. Does anyone have any ideas as to how I can get around this or have experienced something similar? Any help would be immensely appreciated.
This discussion has been closed.
Replies
Allan
Thanks for your quick response! Sorry it took a bit to get back to you. The issue was actually more with AIR than with DataTables, so switching versions didn't matter. I was creating new windows using the HTMLLoader and then injecting HTML into the new windows. I was then trying to apply DataTables to that injected HTML. Any references to the document in the DataTables source code, like document.createElement, were referring to the NativeWindow in AIR, so I it was creating elements in one DOM (the NativeWindow) and moving them into another DOM (the child window). If your AIR application has only the one NativeWindow and you're using DataTables, it works fine. I was able to change the document references to refer to the window I was using for DataTables and it worked fine after that. There may be a way around this or a better way of generating windows in AIR than what I was doing.
Thanks again for your help. Let me know if you'd like me to provide any more info. DataTables is a fantastic plugin!