Hello,

I'm in the process of updating my widget library to ipywidgets 7, and I'm 
trying to figure out how to get a reference to the Cell object on the 
Javascript side.

In ipywidgets 6 and earlier I would do something like the following:

const ExampleWidgetView = widgets.DOMWidgetView.extend({
    render: function () {
        const cell = this.options.cell; 

        if (cell && cell.metadata && cell.metadata.foo) {
            // The cell has the metadata flag we're looking for, do one 
thing when rendering the widget
        }
        else {
            // The cell doesn't have the metadata, do another thing when 
rendering the widget
        }
    }
});


However, in ipywidgets 7 options.cell is undefined. I've been looking through 
the code and so far haven't seen an obvious alternative for getting a reference 
to the Cell object. 


Is there another way this can be done?


Thanks!

Thorin

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/b981b81a-905f-452b-9b2d-0e882e4f3307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to