Closed mwouts closed 2 years ago
A first implementation of the above is available at https://github.com/mwouts/itables/pull/41/commits/d83b6abe9b4aeafc10b3e440ae351bd2dd15d135, however it only works in Jupyter Lab (and not always, for instance when the notebook is reloaded the tables are not shown).
The problems seems to be that the initDataTables
function is not working properly when requirejs
is loaded, for instance in the context of a notebook exported to html with nbconvert.
I'll see if we can get help on this on the datatables.net forum
As a workaround for the problem reported above, we will use import
only when require.js
is not available, cf #43
The
require
library is not available in JupyterLab, thus I'd like to remove this dependency (see also #3 and #39).@fwouts suggested that we could load jQuery and DataTables.net using the new
import
keyword in Javascript and contributed the example below:This seems to work pretty well:![image](https://user-images.githubusercontent.com/29915202/147822519-3f52b97e-ef50-4f9b-b99c-f50288421d62.png)
I'll see how to apply this methodology to replace require in the
itables
package.