Accessing additional sheets in GridJS

I was able to make this work, but I do not feel I should have to do this. I feel both clearHighlights() and removeHighlightInverseRange() should remove the inverse range without having to do these extra steps

        const clearHighlights = () => {
            xs.sheet.clearHighlights();
            xs.sheet.removeHighlightInverseRange();
            xs.sheet.data.inverseObjects = {};
            xs.sheet.data.hasInverse = false;
            xs.sheet.data.inverseData = undefined;
}

@billkamm,

Thanks for providing details and findings about clearing highlights and removing highlight for inverse range. We will evaluate and look into it. We will get back to you soon.

@billkamm
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSGRIDJS-1105

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@billkamm
Actually in clearHighlights we already remove the inverse highlights. Please add xs.reRender() to trigger the UI update (xs.reRender will trigger the ui update for cells content and the images/shapes, compare the use of sheet.table.render() which only trigger the ui update for cells content but not for the images/shapes).

As per your scenario, I have added the custom context menu items to show the highlightInverseRange. I have updated the index.html in the demo project. please have a check.
index2024.0516.zip (27.5 KB)

I am getting “TypeError: e.setFilter is not a function” in this code in xpsreadsheet.js

            }, {
                key: "highlightImg",
                value: function(t, e, n) {
                    var i = this.sheet;
                    i.data,
                    i.canvas;
                    if (e)
                        if (e.setHighlight)
                            e.setHighlight(t, n);
                        else if (this.highlightImgFunc)
                            e.setCustomHighlight(t, this.highlightImgFunc);
                        else {
                            var r = !!t && new fabric.Image.filters.Invert;
                            e.setFilter(r)
                        }
                }

when I call xs.sheet.addHighlightShape(obj.id); This is on the initial load of the workbook, but I do have this code in place to wait before I call addHighlightShape (or any other higlighting)

            if (!xs.sheet.data.isImageOk && !xs.sheet.data.forceIsImageOk) {
                if (retryIfNotReady) {
                    xs.sheet.data.forceIsImageOk = true;
                    setTimeout(tryDrawRedactions, 50, [this, false]);
                }
                return;
            }

Is there something else I need to do to verify that the shapes and images are loaded before I called xs.sheet.addHighlightShape(obj.id)? This is all getting kicked off from the ‘sheet-loaded’ event.

@billkamm,

Thanks for the code segment.

We will evaluate your issue and get back to you with details soon.

@billkamm
Please provide a sample project. It is difficult to reproduce such an issue without a sample.