I am trying to implement a custom Widget and put it on top of the Notebook widget in the main area. My current approach is to insert a new DIV element to the
NotebookPanel element and give it
position:absolute. I want to reuse some existing JupyterLab widgets, but from online resources I can only find ways to add them into some specific positions (left, right sidebars, main area, etc.).
I am wondering what’s the best way to add a Widget to an arbitrary HTMLElement? Some approaches I can think of:
- Insert the widget’s
nodeinto the new HTMLElement, but I think I will lose all data/model/event handlers associated with the widget
- Convert the HTMLElement into an instance of Layout and then add the widget into it? If this is a promising approach, is there any tutorial/example for creating new Layouts?
Any suggestions are appreciated! Thank you in advance!