appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.81k stars 3.64k forks source link

[Bug]: Table widget -> Toggle Editable Mode via JS -> does not work #36111

Open carefine opened 1 week ago

carefine commented 1 week ago

Is there an existing issue for this?

Description

In my table widget, if I make a column editable via the toggle button, it works fine. But if I use the JS textbox, it does not work both ways. true or false. Loom video link attached.

Steps To Reproduce

Link data to your table widget. Try making any column editable via the JS textbox. This problem will arise.

Public Sample App

No response

Environment

Production

Severity

High (Blocker to building or releasing)

Issue video log

https://www.loom.com/share/4fee727483ef4649a5db3003068a2c45?sid=e0444d9a-b738-48e7-ba43-864a9c7a6000

Version

Cloud

Nikhil-Nandagopal commented 1 week ago

@carefine actually the editable field is not meant to be js enabled since the inter linked properties would not be configurable. Is there a use case you have for having this field as editable?

carefine commented 1 week ago

Yes. The use case is that the table must be editable based on timestamp of the row creation. I want the editing to be allowed for upto 15mins after a new row is inserted.

carefine commented 1 week ago

I found a workaround for this.

First set the toggle switch to enabled. Then setup the inter-linked properties.

After that use the js field to auto-enable/disable. It then works as expected.

Nikhil-Nandagopal commented 1 week ago

@carefine That's pretty interesting. Can you tell me a bit more about the type of app you are building that requires such a condition to be enforced? It also seems that this condition should be on the row level and not the column level if I understand correctly.

carefine commented 1 week ago

I'm building a Purchase-Invoice recording app. The user uploads a scanned-PDF of the Purchase-Invoice document. The PDF base64 is then pushed to a lambda function where it then converts the multipage pdf to a single jpg image file stitched below each other. This image file is then pushed to ChatGPT's API aong with the newest-release syntax for Structured-Output response. (The ChatGPT Api does not accept pdf at the moment. Hence, needed to convert it to jpg.)

The near-perfect JSON is then returned to Appsmith. The JSON is then inserted to the AWS RDS MYSQL db.

The data is displayed in a Table Widget. ChatGPT OCR capabilities are 99% perfect. But there is some discrepency sometimes. Its critical that a few fiels like Invoice Number, Supplier Name and a few other are perfectly matching to the actual document. So downstream activities dont get affected.

Now here is where editable table comes into play. I want the user to be able to make these changes to these few fields only upto 15 mins after the API response. So that there is a time-bound pressure on him to complete it. If this time-bound pressure is not there, then given the 10's of invoices we get daily, mistakes may remain uncorrected and affect downstream activites.

Hence, the row level timestamp is used and column level selected fields are made editable. Its turning out to be a neat app.

All very much thanks to you and your splendid team at appsmith.