How to use 'CellRange' api

Tags: #<Tag:0x00007fee2b14ddd8>

I want to know if my cell ranges are overlapping, I saw in the doc that there is a method which is ‘overlaps’ but I can not figure out how to call it.

image

Hi @dannyfsociety

You can use this demo https://jsfiddle.net/zwpdk6qe/ to test how it works.

CMD (command/ctrl) key has to be pressed to select a second layer.
Then in the browser console, you will see the response from the afterSelectionEnd() hook.

The first response from the hook shows that the last parameter (layer) is 0. Now when I make an additional selection, we get another response from the hook with the last parameter being 1. It means that there’s an additional layer.

But now, that layer number does not mean that there selection is made on the same cells. If I click a single cell somewhere else, the layer number will still rise. That is why, to check if the same cell is selected twice, you would need to compare the rest of the parameters that are coordinates of the cells.