Formula Evaluation

Hi, we’re using GridJS in read-only mode, which means users cannot edit any files. Given that the files are never editable, we’d like to disable formula evaluation on both the backend and frontend. Is that possible?

@ShivaGautam

Thank you for reaching out regarding your requirements for GridJS.

In the backend, Aspose.Cells for GridJS typically triggers formula calculation when a workbook is loaded or when specific data changes occur. To prevent this, you can control the calculation behavior via the Config.AutoCalculation property. Setting this to false will ensure that the engine does not automatically evaluate formulas during the initialization or rendering process.

On the frontend, since you are using the control in read-only mode, the UI does not trigger re-calculations unless data is modified. By disabling the backend calculation as mentioned above, the grid will simply display the cached values stored in the spreadsheet file without performing new evaluations.

If you are using the latest version (26.8), please ensure your configuration is set before calling the load methods. We will continue to investigate if there are further specific optimizations for your read-only use case to ensure maximum performance.

Thank you for the clarification.

We are currently using GridJS version 25.3, so I’m not sure whether the Config.AutoCalculation property you mentioned is available in this version. Could you please confirm whether this configuration exists in 25.3 and, if so, where it should be configured?

Based on our understanding, the initialization flow involves passing GridJsOptions to GridJsService, and then using LoadOptions while loading the workbook. We have not been able to find any setting within these objects that allows us to control formula calculation behavior.

Additionally, one of our key requirements is to support cell selection and navigation using the keyboard arrow keys while the grid is in read-only mode. Is this functionality supported in GridJS 25.3? If so, could you please share the recommended configuration or implementation approach?

At the moment, the only way we have been able to achieve keyboard-based cell navigation is by keeping the grid in edit mode, which is not aligned with our intended user experience. Our goal is to retain a read-only grid while still allowing users to navigate and select cells using the arrow keys.

We would appreciate any guidance specific to version 25.3, as the information provided appears to be based on version 26.8.

@ShivaGautam

Thank you for your follow-up questions regarding GridJS. Regarding your versioning query, please note that version 26.8 is not yet available as of August 2026; the current stable release is 26.8.

In version 25.3, the Config.AutoCalculation property is a client-side setting. You can disable automatic formula calculation by setting xs.sheet.config.AutoCalculation = false; in your JavaScript initialization code after the grid object is created. On the backend, since you are using GridJsService, formula evaluation is typically triggered during the UpdateCell or CalculateFormula calls. If you are strictly in read-only mode and not calling these methods, the backend will not perform additional calculations beyond what is already cached in the spreadsheet.

Regarding keyboard navigation in read-only mode, GridJS is designed to support cell selection and arrow key navigation even when editing is disabled. To achieve this in version 25.3, you should ensure the grid is initialized with the isReadOnly: true property in your client-side configuration. This allows the UI to maintain focus and handle keydown events for navigation without activating the cell editor.

We are currently investigating the specific behavior of keyboard events in the read-only state for version 25.3 to ensure there are no regressions. We will provide further updates here once we have more details on the recommended implementation approach for your specific requirements.

Hey any update on cell selection via keyboard in read-only mode

@ShivaGautam
keyboard navagation is always supported whether it is in readonly or edit mode.
it is available in v25.3.

@peter.zhou

The spreadsheet is initialized with the following configuration:

xs.value = new Spreadsheet(el, {

showToolbar: false,

mode: ‘read’,

local: ‘en’,

view: {

width: () => el.clientWidth - -1,

// Library reserves ~26px for the formula bar; ours is 32px.

height: () => el.clientHeight - 6

}

}).loadData(data.data);

When the spreadsheet is configured in read mode (mode: 'read'), users cannot navigate or select cells using the keyboard. However, when the mode is changed to edit mode (mode: 'edit'), keyboard navigation and cell selection work correctly. This suggests that keyboard navigation and selection are disabled or unsupported in read mode.

@ShivaGautam
please provide your sample project .

Sample project?

@ShivaGautam
yes ,please provide your sample project which can reproduce this issue.

You can reproduce the issue by simply setting the spreadsheet mode to read and then attempting to navigate between cells using the arrow keys, similar to how navigation works in Microsoft Excel. You will notice that keyboard navigation and cell selection do not work in read mode. Changing the mode to edit immediately restores the expected keyboard navigation and selection behavior.

@peter.zhou

In the snippet shared earlier, keyboard navigation and cell selection work as expected when mode is set to edit. However, when the same configuration uses mode: 'read', users are unable to navigate between cells or make selections using the arrow keys on the keyboard. This behavior can be easily reproduced by clicking a cell and attempting to move between cells with the keyboard arrow keys, similar to standard Excel navigation. Switching the mode back to edit immediately restores the expected keyboard navigation and selection behavior.

@ShivaGautam
please run this sample demo
Examples_GridJs_v25.3.7z (231.8 KB)
it shows the navagation still works in readonly mode.

can you give us a sample project in java

@ShivaGautam

Thank you for your follow-up. We understand that you are requesting a Java-based sample project to compare against your current implementation, as you are experiencing issues with keyboard navigation specifically when the mode is set to read.

I have updated the existing investigation task with this request and shared your feedback regarding the discrepancy between the edit and read modes with our development team. We will work on preparing a simplified Java project that demonstrates the correct configuration for read-only navigation to help identify why it is not functioning as expected in your environment.

We will notify you here as soon as the sample is ready or if we have further updates regarding the investigation into this behavior. Thank you for your patience.

@ShivaGautam
this is the java demo for v25.3
gridjsdemo.v25.3.7z (211.3 KB)

Hey @peter.zhou , I have found the issue.

The library appears to use a specific element to receive keyboard input. In edit mode, it uses a content-editable element with the class “x-spreadsheet-keyinput”. The library focuses this element whenever keyboard interaction is required, allowing navigation and editing to continue.

In read mode, keyboard navigation and selection appear to rely on the page body instead. This works correctly when the page first loads because the body is the active element by default. At that point, arrow-key navigation and Shift + Arrow range selection work correctly.

The issue occurs after the user clicks another element outside the GridJS Spreadsheet canvas, such as a div, table, input field, or another focusable component. Focus moves from the page body to the clicked element, which is normal browser behavior.

When the user later clicks a cell inside the spreadsheet, the cell is selected and the internal selector is updated, but focus is not restored to the page body or another keyboard input receiver. The selected cell remains visible, but the spreadsheet no longer responds to arrow-key navigation or keyboard-based range selection.

In read mode, selecting a cell should automatically restore the spreadsheet’s keyboard input context. The library could restore focus to the page body if the current implementation depends on it, or use a dedicated focusable keyboard receiver similar to the “x-spreadsheet-keyinput” element used in edit mode.

@ShivaGautam

Thank you for the additional details regarding the focus behavior in read mode.

We have received your feedback concerning the focus restoration to the keyboard input receiver. This specific technical detail has been added to the existing investigation task for our development team to review.

We are continuing to look into why the keyboard navigation is not behaving as expected in your environment when the mode is set to read. We will keep you updated on the progress of this investigation and notify you as soon as a fix or further information becomes available.

I’ve also encountered an another issue where the library strips the leading apostrophe (') from cells containing formula-like text. In Excel, a value such as '=SUM(A1:A5) or '=IF(YEAR(AH11)>2020,C11,(IF(CH11<=36,"Seasoned",INDEX(data!$C$11:$C$50000,MATCH('data tape'!F11,data!$F$11:$F$50000,0))))) is intentionally stored as plain text and should not be treated as a formula. However, after parsing, the leading apostrophe is removed and the value is returned as an executable formula string. This causes downstream consumers to incorrectly interpret the cell as a real formula and attempt evaluation. In my case, the complex formula shown above cannot be evaluated by the UI’s formula engine, which results in an exception, causes the UI to crash, and prevents the sheet from loading altogether. This behavior changes the original semantics of the cell and loses user intent, since the apostrophe was explicitly used to store the formula as text. The library should preserve such values as text or provide metadata indicating that the cell is a text value rather than a formula.

@ShivaGautam

Thank you for providing these additional details regarding the issue where leading apostrophes are stripped from text cells.

We have acknowledged your report that this behavior causes the content to be incorrectly treated as a formula, subsequently leading to a UI crash. This information has been added to the existing investigation task for our development team to review.

The team will analyze how these characters are handled during the rendering process to ensure that text cells are preserved correctly and do not trigger formula evaluation errors. We will keep you updated on the progress of this investigation and notify you as soon as a fix is available in a future release.