On 2 February 2017 at 19:10, TJ Lane <[email protected]> wrote:

> Currently I have one big issue, though: how can I get the cell index for
> the js code that is executing?! This seems like it should be simple, but I
> have been struggling lol.


I played around to see if I could do this. The only way I could do it was
to walk up the DOM, which is hackish - it almost certainly won't work with
Jupyterlab, for instance.

%%javascript
var cell_elt = this.element[0].parentElement.parentElement;
var cell_obj = $(cell_elt).data('cell')
console.log(cell_obj);

-- 
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/CAOvn4qis9Mx670iFbgnbGV1BX%3DDEJuUEZAqA0ZrawZeB%3Dr6Dpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to