[IPython-dev] ipython notebook "current cell changed signal"

Trémouilles David david.trem at gmail.com
Wed Aug 27 05:17:37 EDT 2014


OK. I have finally figured this out by myself :-)

'selected_cell_type_changed.Notebook' is
actually what I was looking for.

I was misled by the naming. My first thought was
that the 'selected_cell_type_changed.Notebook' signal
was /only/ triggered when the selected "cell type" was
changed, actually it is triggered either when the
"selected cell" or the "selected cell type" are changed...

Best regards,

David

Le 26/08/14 21:15, Trémouilles David a écrit :
> Hello,
>
> In the IPython notebook, I would like to trigger a javascript
> function when the notebook currently selected cell changes.
>
> I have found this kind of solution:
>
> %%javascript
> $([IPython.events]).on('select.Cell', function (event, data) {
>            console.log("changed...")
>         });
>
> However it only works when the cell is changed by clicking on
> another one but not when navigating with the up and down arrow key...
> Is there any simple solution to trigger a javascript function
> whenever the selected cell changes ?
>
> (I'm using the current ipython github repo head.)
>
> Thanks in advance,
>
> David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140827/cda405a1/attachment.html>


More information about the IPython-dev mailing list