Hi guys. I will be very grateful If someone help me.
I have implemented statuses for each of cell (“Running”, “Completed”); I have a button “Run”(for every cell). On click on this button I give to it html status block “Running”. And also I have this code -
NotebookActions.executed.connect((_, args) => {
setCellState("");
const { cell } = args;
const cellRunningStatuses = window.document.getElementsByClassName(
"jp-enh-cell-toolbar-direction-status-run"
);
const cellCompletedStatuses = window.document.getElementsByClassName(
"jp-enh-cell-toolbar-direction-status-completed"
);
for (let status of cellRunningStatuses) {
status.classList.add("run");
}
for (let status of cellCompletedStatuses) {
status.classList.remove("active");
}
cell.node
.getElementsByClassName("jp-enh-cell-toolbar-direction-status-run")[0]
?.classList?.remove("run");
cell.node
.getElementsByClassName(
"jp-enh-cell-toolbar-direction-status-completed"
)[0]
?.classList?.add("active");
});
whick executes when cell running if completed. And in this place I change status “Running” → “Completed”.
But also I have “Run all” button which execute:
commands.execute("runmenu:run-all");
For now my sollution is - to give to all cells statuses - “Running”, and with the code above change executed cell status to “Complete” one by one.
But I need not to make “Running” to all cells but only to this cell which is runs in this moment.
Something like:
“Run all” → Cell1 “Running” → Cell1 “Completed” → Cell2 “Running” → Cell2 “Completed” → finish.
Is there such listener ?