Category: Widget
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How to Make Columns Editable Programmatically

Issue

I am trying to make dynamic columns in a table editable, but there is currently no way to control the Editable property through code. The UI option to make columns editable will not work as new columns are added dynamically. I need to be able to attach a function to the onSubmit event that will save the edited data to the database and identify the row and column that was edited. I have tried prepopulating the columns and enabling the master checkbox, but these solutions do not work for dynamic columns. I have filed a feature request for this functionality.

Resolution

To solve this problem you can enable JS for the Editable property in the column settings of your Table and use a JS expression.

Javascript is enabled for the editable property of the column, which contains a reference to a variable in the Appsmith store