# Can a table column editable be change at runtime?

**URL:** <https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451>\
**Category:** General Discussion\
**Tags:** vision\
**Created:** [December 16, 2014, 3:50am UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451 "2014-12-16T03:50:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmonter](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jmonter](https://forum.inductiveautomation.com/u/jmonter)\
**Post date:** [December 16, 2014, 3:50am UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/1 "2014-12-16T03:50:05Z")

</div>

Hi All,  
Need help, I trying to minimize my work and would like to know if there is away to change a tables attribute to allow columns to be editable at runtime, just like you would through the table customizer.

Here is what I want to do,  
I want to have several buttons that will:

1. change the dataset of a table (that's not a problem)
2. change certain columns to editable.

ether the standard table or the power table.

Thanks

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [December 16, 2014, 5:39am UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/2 "2014-12-16T05:39:27Z")

</div>

Sure, this can be done.

Which cells are editable is stored in the columnAttributesData property of a table.

You just need to modify the dataset on that property to configure which columns are editable or not. This can be done dynamically at runtime by using a Python script or a Cell Update binding.

Best,

---

<div class="post-metadata">

**Author:** ![jmonter](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jmonter](https://forum.inductiveautomation.com/u/jmonter)\
**Post date:** [December 16, 2014, 8:15am UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/3 "2014-12-16T08:15:22Z")

</div>

I manage to figure out how to change the “table column editable at runtime” using the script below. Now the problem I have is the columnAttributesData does not change when the dataset is change to query a different database\_table, unless the Table Customizer is open. Does anyone know how to update the columnAttributesData to reflect the new query.

objTable = event.source.parent.getComponent(‘Table’).columnAttributesData  
rows=event.source.parent.getComponent(‘Table’).data.columnCount

#Set Table Columns Editable  
for i in range(rows):  
if i \> 0:  
objTable = system.dataset.setValue(objTable,i,“Editable”, True)  
event.source.parent.getComponent(‘Table’).columnAttributesData = objTable

#Set Table Columns not Sortable  
for i in range(rows):  
objTable = system.dataset.setValue(objTable,i,“Sortable”, False)  
event.source.parent.getComponent(‘Table’).columnAttributesData = objTable

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [April 25, 2024, 1:52pm UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/4 "2024-04-25T13:52:24Z")

</div>

I am having an issue with this as well with version 8.1.25.  
I have a script that sets the power table data to a different table query result depending on which machine I am looking at. I was trying to update the numberFormat column after loading the data, but it seems that the column attributes data does not refresh to match the new data. As mentioned by @jmonter it only seems to refresh when the customizer is opened and closed in the designer.

I need a runtime solution. Any ideas?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 25, 2024, 2:00pm UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/5 "2024-04-25T14:00:00Z")

</div>

~~Two~~ Three approaches:

- Populate the c-a-d with rows for all possible column names for all of the queries you will be using. Use the designer's dataset editor to copy out the possibilities to a text editor, then manually construct the composite with copy and paste.

- Populate the c-a-d with a binding that examines the new table dataset, iterates through the column definitions, and constructs the necessary c-a-d rows on the fly.

- Place copies of the c-a-d for each query into some other storage (even a local dataset to filter) and bind c-a-d to an expression or query that retrieves the right copy.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [April 25, 2024, 2:00pm UTC](https://forum.inductiveautomation.com/t/can-a-table-column-editable-be-change-at-runtime/9451/6 "2024-04-25T14:00:54Z")

</div>

Thanks. And I just noticed you answered this here:

> [@Power table changing datasets and making them editable](https://forum.inductiveautomation.com/t/power-table-changing-datasets-and-making-them-editable/61231):
>
> Hi, I’m trying to make a simple dataset editor tool where you can chose a dataset tag in a tag browse tree and then the data is displayed in a power table where you should be able to edit the data. The problem is that when I choose a dataset the ‘editable’ flag for each column is false by default. I could set them to true for each column in the ‘Column Attributes Data’, but when I choose a new dataset tag in the tag browse tree then the ‘Column Attributes Data’ would change and I would have to…
