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:
change the dataset of a table (that's not a problem)
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.
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.
#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
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.
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.