I need to open A1 when the mouse clicks on other cells, such as C1. At this time, my A1 cell should remain open and refer C1 to my A1. Similar to the formula calculation in Excel.
Handsontable. Editors. TextEditor. Prototype. The extend ();
But I don’t want to rewrite the editor,
I want to use hook events to implement values that appear when the editor is opened, values that appear when it is closed, and a separate renderer of the cell.
is used to do something in the background but any UI changes (selection, styling, data changes) won’t appear as you need to rerender the table and rendering closes the editor.
Yes, the renderer is called after the setDataAtCell method is called. You can add a condition to the renderer to use the setDataAtCell if the value differs from the setDataAtCell value. This will stop the infinite loop.
@aleksandra_budnik
Thanks,
1.but getDataAtCell() when I need it; To return null, I need this value。
2.When I use a custom renderer, it actually renders the number of cells X2. Why is that? minRows : 20, minCols : 20, hot.updateSettings({ renderer : cellRenderer }); function cellRenderer(hotInstance, td, row, col, prop, value, cellProperties) { debug("test"); if (typeof cellProperties.fm != "undefined") { } }
I need to be in the rendering process, please note that it is in the rendering process, not after the rendering. Look for anything in getCellMeta() that needs to be computed.
I need to assign the result to the cell after calculation, using setDataAtCell();
However, with setDataAtCell(), the render event is triggered, which is an infinite loop.
If I use td.innerhtml =newValue, this works and doesn’t trigger a render event, but I can’t get the value from getDataAtCell() where I need it.
I need to be in the rendering process, please note that it is in the rendering process, not after the rendering. Look for anything in getCellMeta() that needs to be computed.
currently can you only process the actions in the afterRender mode. But, maybe there are other hooks that can help, as the rendering is the last step when you make changes.
However, with setDataAtCell(), the render event is triggered, which is an infinite loop.
here Handsontable example - JSFiddle - Code Playground is an example on how to prevent the loop. Let me know if it works for you.
@aleksandra_budnik
For now, I’m getting what I need.
Then, why do multiple selected cells appear when typing Chinese? Look at the picture below。
This is perfectly normal for reentering characters or Numbers.
It looks like an issue with IME. When does it happen? I typed 是 in my last demo https://jsfiddle.net/3h8s1x4q/ but did not get the issue (tested on Chrome 71/ Windows 10)