Closed kpagcha closed 3 years ago
You need to defined the var ignoreEvents to true for not recall onchange
onchange: function (instance, cell, x, y, value) {
jexcel.current.ignoreEvents = true;
const name = jexcel.getColumnNameFromId([y, x]);
jexcel.current.setValue(name, value);
jexcel.current.ignoreEvents = false;
}
Also what's the listener for when a single cell is selected and when it loses focus?
For selected I could use onselection
although it doesn't discriminate between dragging and simply clicking a cell (would be forced to use borders).
But how about losing a selection? ("blur")
maybe i don't understand you question.
For detect blur you have event onblur
For make a blur : jspreadsheet.current.resetSelection(true);
I am building a symmetric table:
And I'm trying to implement the following behavior: when the value of a cell is changed, the mirror cell should be automatically updated. So I plugged in the following function to the
onchange
listener:Problem: changing the other cell's value also triggers the listener and we end up in a recursion loop.
I wouldn't think changing another cell's value when changing one is such a weird ask, so what am I doing improperly here?