reference to document is fixed @ loading time, no way to change that.
reference to document is fixed @ loading time, no way to change that.
Allan,
Possibly a bug, certainly a limitation (I qualify this by saying a limitation TO ME, as I do not think this is a general use case) : the reference to the document to which the datatable belongs is fixed when the DT plugin is loaded, subsequent datatable() call thus reference the originating document, not the document the DT belongs to.
In short this prevents to use a datatable in an inframe, where I did not want to load jQuery, datatable and each and every plugin I use. Using the context parameter of the jQuery call works fine to locate the table in the iFrame from the parent window, but during the datatable() call various elements are created, in the context of the original document, not the iFrame one and I very rapidly get a 'DOM 4 uncaught exception' meaning that DT is trying to append elements not belonging to the same document.
How difficult would it be to add a setup parameter ? my low understanding of how plugins work do not allow me to test it myself. Any explanation to get my started at trying this would be fantastic; if it work I could then submit a patch to you.
If it is a no-no, I'll have to resort to loading the same scripts for each iFrame, but I really hate to do this.
Thanks for your input
Didier
Possibly a bug, certainly a limitation (I qualify this by saying a limitation TO ME, as I do not think this is a general use case) : the reference to the document to which the datatable belongs is fixed when the DT plugin is loaded, subsequent datatable() call thus reference the originating document, not the document the DT belongs to.
In short this prevents to use a datatable in an inframe, where I did not want to load jQuery, datatable and each and every plugin I use. Using the context parameter of the jQuery call works fine to locate the table in the iFrame from the parent window, but during the datatable() call various elements are created, in the context of the original document, not the iFrame one and I very rapidly get a 'DOM 4 uncaught exception' meaning that DT is trying to append elements not belonging to the same document.
How difficult would it be to add a setup parameter ? my low understanding of how plugins work do not allow me to test it myself. Any explanation to get my started at trying this would be fantastic; if it work I could then submit a patch to you.
If it is a no-no, I'll have to resort to loading the same scripts for each iFrame, but I really hate to do this.
Thanks for your input
Didier
This discussion has been closed.
Replies
This is probably a bit of an edge case I think, so not something that I'll put into the DataTables core at this time - but of course you could always fork the project and replace those references with a context switching variable.
Allan
The only issue I have now is to allocate events from the parent window, (e.g. rowclick) as I don't seem to find the correct syntax. I'll leave it aside for the moment as time presses, but will get back to it.
Regards,
Allan