Open marcobsidian opened 2 months ago
Hi @marcobsidian, I wasn't able to find the API you mentioned in the Spreadsheet
component:
I am afraid I am missing something here, could you provide more details, maybe a project with the reproducible code?
Okay I double checked again and it is actually a hilarious error on my side.
For context: We are using Kotlin for our project. Also, we are using the Spreadsheet within our own CustomField
None of us realised that the read-only assignment within the apply
targeted the wrapping CustomField and not the Spreadsheet. ^^'
If i change the call to this.isReadOnly = true
, it correctly gives me a compiler error.
I was clearly wrong about this being a bug. The quality of Vaadin Pro Components is clearly better than the eyesight of me and my colleagues ^^'
However, while this isn't a bug, it would still be very helpful to have ways to disable interaction with the Spreadsheet component.
Our current "workaround" (see code pic above) isnt really doing it.
Are there any existing tools we overlooked to get a interactable, but not editable Excel Preview. If not, would it be possible to add something like this as an enhancement in close future?
Hi,
After some investigation, I discovered that the Spreadsheet GWT widget does have some kind of a read-only state implementation, but for whatever reason it's not exposed publicly with the Spreadsheet
component.
While there currently isn't a public read-only mode for the component, maybe as a workaround you could consider locking all the cells programmatically.
Description
Within our application, we want to use the Vaadin Spreadsheet as a File Preview for Excel Files.
These files shouldnt be editable, only viewable. We expected to achieve this by setting the "readOnly" or "enabled" -Properties of the Spreadsheet, similar to other components. Sadly, this does not work, as it currently results in this:
Setting a Spreadsheet to Read-Only (readOnly=true)
Setting a Spreadsheet to disabled (enabled=false)
We think this current behavior is flawed or at least very confusing and unituitive. We expected more of a "Pro-only" component.
Expected outcome
Setting a Spreadsheet to read-only achieves the following
Setting a Spreadsheet to disabled achieves the following
Minimal reproducible example
Paste this in any empty Vaadin View.
Steps to reproduce
Open a page that includes the Minimal reproducible example above
Environment
Vaadin version(s): 24.3 OS: Windows 11
Browsers
Chrome, Edge