However, when the user clicks on this menu, the Cell Editor closes. The documentation mentions how to handle a similar case with keyboard events, but not with mouse. What function should I override to handle when the cell editor should close? (the function can be as simple as reading a global variable to know whether or not to close). I am extending the Text Editor.
Hi @aabounegm,
this example could be helpful for you: http://jsfiddle.net/5zh2mun9/ click event is added into editor.eventManager and editor is still open even if you click in div element below.
One problem, though. The div is created externally, and not appended to the Editor’s TEXTAREA. It is a standalone element that is already there but hidden and simply appears in the right position with a special event. Would be as simple as using the same this.eventManager.addEventListener() but with the other external div instead?
Because of the fact that if you call mousedown event outside of the Handsontable’s container, then active instance calls ‘unlisten()’. To prevent this behaviour, it’s necessary to set cell selection manually in the next cycle (setTimeout).
My problem is not in cell selection. In your demo, I want the editor to be still active after I click on the button. This is just the simple version of what I am trying to achieve.
And if this is possible, can it be done if the ‘button’ is already created somewhere else?