Column attributes refresh

Hello, I’m using ignition 7.3.8, vision 5.3.6, I have a table, with data dynamicaly changed. Each time when I overwrite data, column attributes remain same (outdated), and update only when I enter table customizer and press ok. So, because of this issue, I can’t make specific cells editable, like I’m adviced here:
viewtopic.php?f=70&t=7133&p=22596&hilit=column+attributes#p22596

That is the correct behavior. You can dynamically edit cells of the dataset through a “Cell Update” binding or through scripting.

Look, I have a single table component, I need to change it’s data dynamicaly, so it would show chosen database table (tables have different columns). I bind it’s data field to sql query, and insert database table name as property. What I get is table that changes is content according to that property value. But every time content changes, all columns become not editable, and I cannot edit column attributes list, as it is outdated, and I need to refresh it first, but I don’t know how.

You are correct in thinking you have to edit the column attribute dataset. To do this put code like the following on the table’s propertyChange event:if event.propertyName == "data": headers = ["name","editable"] rows = [] if event.source.tableName == "table1": rows.append(["ColumnName", True]) elif event.source.tableName == "table2": rows.append(["OtherColumnName", True]) event.source.columnAttributesData = system.dataset.toDataSet(headers, rows)This code is run whenever the data being displayed in the table changes. It creates a dataset with the name of the column being set to editable - this depends on the table you are changing to, which is held here in a custom property of the table called ‘tableName’.

The dataset you create is then used to overwrite the table’s columnAttributesData dataset. Note that the other fields you don’t specify will just be set to default values - this seems to work without problems. If you want to update any other values for the column, just include more properties in the headers list and set its value in the rows list. If you want to update more than one column, just append another row.