Accessing additional sheets in GridJS

The issue as seen in “highlight disappears when clicked.gif” in the post above is still occurring
Accessing additional sheets in GridJS - #43 by billkamm

@billkamm,

Thanks for providing further details.

We have reopened your existing issue (logged earlier as “CELLSGRIDJS-902”). We will look into it soon.

Once we have an update on it, we will let you know here.

@billkamm
The issue as seen in “highlight disappears when clicked.gif” will be fixed in the next coming v23.10 release.
selecttextbox.gif (64.9 KB)
this is a preview snapshot. please have a check.

image highlights turn off on horizontal scroll.gif (134.6 KB)

When I click on a textbox object that is highlight and scroll horizontally the highlight disappears. If I then try to click in the textbox it won’t select the textbox unless I click in a different cell and then re-click in the textbox. Also, sometimes on scrolling when the highlight disappears a single select shows a highlight somewhere else on the spreadsheet

I also I have no way of right-clicking on a textbox object to bring up a context menu when in read only mode. I can right-click on images to bring up a context menu, but not a textbox. I need to be able to bring up a context menu on a selected textbox in read only mode

@billkamm,

Thank you for the screenshot, which shows that image highlights turn off when doing horizontal scrolling. We will evaluate this issue and your other mentioned issue (referring to right-clicking on a textbox object to bring up a context menu in read-only mode) in detail. We will get back to you soon with our updates and findings.

@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-1034,CELLSGRIDJS-1035

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
It shall be ok in the latest version. please try my demo project.
gridjs-demo-customer.v24.3.zip (1.7 MB)
here we can see ,it can show the context menus when right mouse click the textbox shapes
textboxselect.gif (871.1 KB)

Does this fix the disappearing highlights on scroll as well or just the context menu issue? I see in your animated gif you highlighted text within the texbox and scrolled horizontally, but my issue was specifically when the whole textbox is highlighted as in highlighting an object the same way you would highlight an image.

@billkamm,

It fixes the context menu issue. We could not reproduce the disappearing highlights issue on scroll yet.

Thanks for providing more details. We will be looking into it and get back to you soon.

@billkamm
Both the disappear highlight and show context menu issues for textbox are fixed, we cannot reproduce them as you can see in the project we provided. For this
‘textbox is highlighted as in highlighting an object the same way you would highlight an image’
– we don’t quite understand your requirement.

If you still have issues, can you update your code in the project to show your finding, so that we can go ahead.

What version will the fixes be released in? I’ll check them and see if the disappearing highlight problem is still an issue for me

The disappearing appears to only occur when you select the entire textbox object which has the entire object object (not the text inside, but the textbox itself)

horizontal scroll issues for highlighted and selected textbox.zip (1018.2 KB)

I uploaded a video of the issue. I did have to refresh after adding the highlight before noticing the issue.

@billkamm,

Thanks for providing further details and video.

We will get back to you soon.

@billkamm
Can you provide the code detail for the highlight on textbox( the redact operation), we can then mimic it in our demo project.
Please check my project we provided.
Here we use the latest V 24.3 version

@billkamm
Now we have released the latest version v24.4.
We cannot reproduce your issue in this version.
If you still encounter any issues, please let us know.
We will always be here to help you.

24.4 fixed the issue with the horizontal scrolling. Is there a way to remove all highlights from a sheet at once? We were doing it with the code below, but we removed it because it was causing issues with the show and hiding of highlights (changing the visibility of the highlights). At the moment out code in our project is set to add all of the highlights fresh every time you load a sheet, but in order to do that we need to remove all of the existing highlights when we refresh the page of the sheet we are currently on. We need to refresh the page when we save what we have highlighted to our database, so we felt this was the best approach when we started our project, but now we are stuck without a good to way remove all of the highlights at once

        function removeAllHighlights() {
            //Need to do shallow copy of highlights because remove methods pop them out of array
            const texts = xs.sheet.highlight.getHighlightTexts();
            if (texts.length > 0) {
                const textsCopy = [...texts];
                textsCopy.forEach(r => xs.sheet.removeHighlightText(r.row, r.col))
            }
            const ranges = xs.sheet.highlight.getHighlightRanges();
            if (ranges.length > 0) {
                const rangesCopy = [...ranges];
                rangesCopy.forEach((r) => { xs.sheet.removeHighlightRange(r.sri, r.sci, r.eri, r.eci) });
            }
            const images = xs.sheet.highlight.getHighlightImages();
            if (images.length > 0) {
                const imagesCopy = [...images];
                imagesCopy.forEach(r => xs.sheet.removeHighlightImage(r))
            }
            const shapes = xs.sheet.highlight.getHighlightShaps();
            if (shapes?.length > 0) {
                const shapesCopy = [...shapes];
                shapesCopy.forEach((s) => {
                    const shape = xs.sheet.data.shapes.find(x => x.id === s)
                    xs.sheet.removeHighlightShape(s);
                    if (shape.type === "TextBox") {
                        shape.highlighttxts?.reduceRight((_, h) =>
                            shape.removeHighlight(h.start, h.end), null);
                        if (shape.origBackgroundColor) {
                            shape.setBackgroundColor(shape.origBackgroundColor);
                            delete shape.origBackgroundColor;
                            shape.hideText(false);
                        }
                    }
                });
            }
            xs.sheet.removeHighlightInverseRange();
            xs.sheet.data.inverseObjects = {};

            //necessary to clear highlights, but can throw an error on certain objects
            //silently catching the error because we remove object highlights above
            try {
                xs.sheet.setHighlightAll(false);
            }
            catch { }

            xs.sheet.data.hasInverse = false;
            xs.sheet.data.inverseData = undefined;
        }

@billkamm,

Thank you for sharing your findings and code snippet. We will evaluate your requirements and get back to you soon.

I should note that we removed that code because of the bullet 2 in this post

@billkamm
It seems like you want to persist highlight objects. We will provide you with a demo to remove all highlight objects and then re-add them.