DataTables in Adobe AIR

DataTables in Adobe AIR

nsbinghamnsbingham Posts: 2Questions: 0Answers: 0
edited June 2010 in General
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.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'd suggest first of all upgrading to 1.7 beta 2 (or 1.6.2 stable) as there has been a lot of chances since 1.5.0 beta 7. If you are still getting an error then, if you could tell me the line number, that would be great. I've used DataTables in one or two AIR apps myself and not run into this, but it would be good to maintain full compatibility with AIR.

    Allan
  • nsbinghamnsbingham Posts: 2Questions: 0Answers: 0
    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!
This discussion has been closed.